Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: jni/jsEngine.cpp

Issue 9570024: ABP/Android Fix crash on unescaped uri (Closed)
Patch Set: Created March 6, 2013, 2:55 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/org/adblockplus/android/AdblockPlus.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of the Adblock Plus, 2 * This file is part of the Adblock Plus,
3 * Copyright (C) 2006-2012 Eyeo GmbH 3 * Copyright (C) 2006-2012 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 { 157 {
158 D(D_WARN, "nativeExecute()"); 158 D(D_WARN, "nativeExecute()");
159 v8::HandleScope handle_scope; 159 v8::HandleScope handle_scope;
160 160
161 v8::Persistent<v8::Context> context((v8::Context *) pContext); 161 v8::Persistent<v8::Context> context((v8::Context *) pContext);
162 v8::Context::Scope context_scope(context); 162 v8::Context::Scope context_scope(context);
163 163
164 const std::string script = getString(pEnv, pScript); 164 const std::string script = getString(pEnv, pScript);
165 165
166 v8::Handle<v8::String> source = v8::String::New(script.c_str(), script.size()) ; 166 v8::Handle<v8::String> source = v8::String::New(script.c_str(), script.size()) ;
167 v8::Handle<v8::Script> compiledScript = v8::Script::Compile(source); 167 v8::Handle<v8::Script> compiledScript;
168 {
169 v8::TryCatch try_catch;
Felix Dahlke 2013/03/06 15:06:35 You could just use the same TryCatch for both Comp
170 compiledScript = v8::Script::Compile(source);
171 if (try_catch.HasCaught())
172 {
173 reportException(&try_catch);
174 return NULL;
175 }
176 }
168 { 177 {
169 v8::TryCatch try_catch; 178 v8::TryCatch try_catch;
170 v8::Handle<v8::Value> result = compiledScript->Run(); 179 v8::Handle<v8::Value> result = compiledScript->Run();
171 if (try_catch.HasCaught()) 180 if (try_catch.HasCaught())
172 { 181 {
173 reportException(&try_catch); 182 reportException(&try_catch);
174 return NULL; 183 return NULL;
175 } 184 }
176 else 185 else
177 { 186 {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 long r = 0; 280 long r = 0;
272 while (r == 0) 281 while (r == 0)
273 { 282 {
274 v8::TryCatch try_catch; 283 v8::TryCatch try_catch;
275 r = RunNextCallback(context); 284 r = RunNextCallback(context);
276 if (try_catch.HasCaught()) 285 if (try_catch.HasCaught())
277 reportException(&try_catch); 286 reportException(&try_catch);
278 } 287 }
279 return (jlong) r; 288 return (jlong) r;
280 } 289 }
OLDNEW
« no previous file with comments | « no previous file | src/org/adblockplus/android/AdblockPlus.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld