Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp

Issue 2700293002: DevTools: do not use RAII for sync native breakpoints, reuse AsyncTask where possible. (Closed)
Patch Set: same with unused assert removed - assert is trivial Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } // namespace 120 } // namespace
121 121
122 v8::Local<v8::Value> ScriptController::executeScriptAndReturnValue( 122 v8::Local<v8::Value> ScriptController::executeScriptAndReturnValue(
123 v8::Local<v8::Context> context, 123 v8::Local<v8::Context> context,
124 const ScriptSourceCode& source, 124 const ScriptSourceCode& source,
125 AccessControlStatus accessControlStatus) { 125 AccessControlStatus accessControlStatus) {
126 TRACE_EVENT1("devtools.timeline", "EvaluateScript", "data", 126 TRACE_EVENT1("devtools.timeline", "EvaluateScript", "data",
127 InspectorEvaluateScriptEvent::data( 127 InspectorEvaluateScriptEvent::data(
128 frame(), source.url().getString(), source.startPosition())); 128 frame(), source.url().getString(), source.startPosition()));
129 InspectorInstrumentation::NativeBreakpoint nativeBreakpoint( 129 InspectorInstrumentation::NativeBreakpoint nativeBreakpoint(
130 frame()->document(), "scriptFirstStatement", false); 130 frame()->document(), "scriptFirstStatement");
131 131
132 v8::Local<v8::Value> result; 132 v8::Local<v8::Value> result;
133 { 133 {
134 V8CacheOptions v8CacheOptions = 134 V8CacheOptions v8CacheOptions =
135 cacheOptions(source.resource(), frame()->settings()); 135 cacheOptions(source.resource(), frame()->settings());
136 136
137 // Isolate exceptions that occur when compiling and executing 137 // Isolate exceptions that occur when compiling and executing
138 // the code. These exceptions should not interfere with 138 // the code. These exceptions should not interfere with
139 // javascript code we might evaluate from C++ when returning 139 // javascript code we might evaluate from C++ when returning
140 // from here. 140 // from here.
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 for (size_t i = 0; i < resultArray->Length(); ++i) { 381 for (size_t i = 0; i < resultArray->Length(); ++i) {
382 v8::Local<v8::Value> value; 382 v8::Local<v8::Value> value;
383 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) 383 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value))
384 return; 384 return;
385 results->push_back(value); 385 results->push_back(value);
386 } 386 }
387 } 387 }
388 } 388 }
389 389
390 } // namespace blink 390 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698