| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 if (frame()->settings()) | 168 if (frame()->settings()) |
| 169 v8CacheOptions = frame()->settings()->v8CacheOptions(); | 169 v8CacheOptions = frame()->settings()->v8CacheOptions(); |
| 170 | 170 |
| 171 // Isolate exceptions that occur when compiling and executing | 171 // Isolate exceptions that occur when compiling and executing |
| 172 // the code. These exceptions should not interfere with | 172 // the code. These exceptions should not interfere with |
| 173 // javascript code we might evaluate from C++ when returning | 173 // javascript code we might evaluate from C++ when returning |
| 174 // from here. | 174 // from here. |
| 175 v8::TryCatch tryCatch; | 175 v8::TryCatch tryCatch; |
| 176 tryCatch.SetVerbose(true); | 176 tryCatch.SetVerbose(true); |
| 177 | 177 |
| 178 v8::Handle<v8::Script> script = V8ScriptRunner::compileScript(source, is
olate(), corsStatus, v8CacheOptions); | 178 v8::Local<v8::Script> script; |
| 179 if (!V8ScriptRunner::compileScript(source, isolate(), corsStatus, v8Cach
eOptions).ToLocal(&script)) |
| 180 return result; |
| 179 | 181 |
| 180 if (compilationFinishTime) { | 182 if (compilationFinishTime) { |
| 181 *compilationFinishTime = WTF::monotonicallyIncreasingTime(); | 183 *compilationFinishTime = WTF::monotonicallyIncreasingTime(); |
| 182 } | 184 } |
| 183 // Keep LocalFrame (and therefore ScriptController) alive. | 185 // Keep LocalFrame (and therefore ScriptController) alive. |
| 184 RefPtrWillBeRawPtr<LocalFrame> protect(frame()); | 186 RefPtrWillBeRawPtr<LocalFrame> protect(frame()); |
| 185 result = V8ScriptRunner::runCompiledScript(isolate(), script, frame()->d
ocument()); | 187 if (!V8ScriptRunner::runCompiledScript(isolate(), script, frame()->docum
ent()).ToLocal(&result)) |
| 188 return result; |
| 186 ASSERT(!tryCatch.HasCaught() || result.IsEmpty()); | 189 ASSERT(!tryCatch.HasCaught() || result.IsEmpty()); |
| 187 } | 190 } |
| 188 | 191 |
| 189 InspectorInstrumentation::didEvaluateScript(cookie); | 192 InspectorInstrumentation::didEvaluateScript(cookie); |
| 190 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Update
Counters", "data", InspectorUpdateCountersEvent::data()); | 193 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Update
Counters", "data", InspectorUpdateCountersEvent::data()); |
| 191 | 194 |
| 192 return result; | 195 return result; |
| 193 } | 196 } |
| 194 | 197 |
| 195 bool ScriptController::initializeMainWorld() | 198 bool ScriptController::initializeMainWorld() |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 resultArray->Set(i, evaluationResult); | 587 resultArray->Set(i, evaluationResult); |
| 585 } | 588 } |
| 586 | 589 |
| 587 if (results) { | 590 if (results) { |
| 588 for (size_t i = 0; i < resultArray->Length(); ++i) | 591 for (size_t i = 0; i < resultArray->Length(); ++i) |
| 589 results->append(resultArray->Get(i)); | 592 results->append(resultArray->Get(i)); |
| 590 } | 593 } |
| 591 } | 594 } |
| 592 | 595 |
| 593 } // namespace blink | 596 } // namespace blink |
| OLD | NEW |