| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. | 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions are | 7 * modification, are permitted provided that the following conditions are |
| 8 * met: | 8 * met: |
| 9 * | 9 * |
| 10 * * Redistributions of source code must retain the above copyright | 10 * * Redistributions of source code must retain the above copyright |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 CacheOptions(source.GetResource(), GetFrame()->GetSettings()); | 121 CacheOptions(source.GetResource(), GetFrame()->GetSettings()); |
| 122 | 122 |
| 123 // Isolate exceptions that occur when compiling and executing | 123 // Isolate exceptions that occur when compiling and executing |
| 124 // the code. These exceptions should not interfere with | 124 // the code. These exceptions should not interfere with |
| 125 // javascript code we might evaluate from C++ when returning | 125 // javascript code we might evaluate from C++ when returning |
| 126 // from here. | 126 // from here. |
| 127 v8::TryCatch try_catch(GetIsolate()); | 127 v8::TryCatch try_catch(GetIsolate()); |
| 128 try_catch.SetVerbose(true); | 128 try_catch.SetVerbose(true); |
| 129 | 129 |
| 130 v8::Local<v8::Script> script; | 130 v8::Local<v8::Script> script; |
| 131 if (!V8Call( | 131 if (!V8ScriptRunner::CompileScript(source, GetIsolate(), |
| 132 V8ScriptRunner::CompileScript( | 132 access_control_status, v8_cache_options) |
| 133 source, GetIsolate(), access_control_status, v8_cache_options), | 133 .ToLocal(&script)) |
| 134 script, try_catch)) | |
| 135 return result; | 134 return result; |
| 136 | 135 |
| 137 if (!V8Call(V8ScriptRunner::RunCompiledScript(GetIsolate(), script, | 136 if (!V8ScriptRunner::RunCompiledScript(GetIsolate(), script, |
| 138 GetFrame()->GetDocument()), | 137 GetFrame()->GetDocument()) |
| 139 result, try_catch)) | 138 .ToLocal(&result)) |
| 140 return result; | 139 return result; |
| 141 } | 140 } |
| 142 | 141 |
| 143 return result; | 142 return result; |
| 144 } | 143 } |
| 145 | 144 |
| 146 bool ScriptController::ShouldBypassMainWorldCSP() { | 145 bool ScriptController::ShouldBypassMainWorldCSP() { |
| 147 v8::HandleScope handle_scope(GetIsolate()); | 146 v8::HandleScope handle_scope(GetIsolate()); |
| 148 v8::Local<v8::Context> context = GetIsolate()->GetCurrentContext(); | 147 v8::Local<v8::Context> context = GetIsolate()->GetCurrentContext(); |
| 149 if (context.IsEmpty() || !ToLocalDOMWindow(context)) | 148 if (context.IsEmpty() || !ToLocalDOMWindow(context)) |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 for (size_t i = 0; i < result_array->Length(); ++i) { | 365 for (size_t i = 0; i < result_array->Length(); ++i) { |
| 367 v8::Local<v8::Value> value; | 366 v8::Local<v8::Value> value; |
| 368 if (!result_array->Get(context, i).ToLocal(&value)) | 367 if (!result_array->Get(context, i).ToLocal(&value)) |
| 369 return; | 368 return; |
| 370 results->push_back(value); | 369 results->push_back(value); |
| 371 } | 370 } |
| 372 } | 371 } |
| 373 } | 372 } |
| 374 | 373 |
| 375 } // namespace blink | 374 } // namespace blink |
| OLD | NEW |