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

Unified Diff: Source/bindings/dart/DartDebugServer.cpp

Issue 24989007: Model each Dart library as its own ScriptState when devtools are enabled. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/dart/DartDebugHooks.js ('k') | Source/bindings/dart/DartHandleProxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/dart/DartDebugServer.cpp
diff --git a/Source/bindings/dart/DartDebugServer.cpp b/Source/bindings/dart/DartDebugServer.cpp
index 8136fe259d4865bd382c649504bdede38a9e6350..c626779a8a32db410cf708ee403e69cee4836f44 100644
--- a/Source/bindings/dart/DartDebugServer.cpp
+++ b/Source/bindings/dart/DartDebugServer.cpp
@@ -183,6 +183,14 @@ void DartDebugServer::isolateLoaded()
ASSERT(Dart_CurrentIsolate());
int isolateHandle = isolateMap().getByValue(Dart_CurrentIsolate());
+ ScriptState* scriptState = ScriptState::current();
+ Frame* frame = DartUtilities::domWindowForCurrentIsolate()->frame();
+ DartController* controller = DartController::retrieve(frame);
+ Vector<ScriptState*> scriptStates;
+ controller->collectScriptStatesForIsolate(Dart_CurrentIsolate(), DartUtilities::currentV8Context(), scriptStates);
+ for (size_t i = 0; i< scriptStates.size(); i++)
+ InspectorInstrumentation::didCreateIsolatedContext(frame, scriptStates[i], 0);
+
ASSERT(!m_dartDebugObject.isEmpty());
v8::Local<v8::Function> isolateLoaded = v8::Local<v8::Function>::Cast(dartDebugObject()->Get(v8::String::New("isolateLoaded")));
v8::Handle<v8::Value> args[] = { v8::Number::New(isolateHandle) };
@@ -454,8 +462,9 @@ static void evaluateInScope(const v8::FunctionCallbackInfo<v8::Value>& args)
v8::Handle<v8::Value> receiver = args[1];
v8::Handle<v8::Object> functionProxy = args[2].As<v8::Object>();
v8::Handle<v8::Value> localVariablesProxy = args[3];
+ bool disableBreak = args[4]->BooleanValue();
- DartScopes scopes(functionProxy);
+ DartScopes scopes(functionProxy, disableBreak);
Dart_Handle target = 0;
if (receiver->IsNull() || receiver->IsUndefined()) {
Dart_Handle functionHandle = scopes.handle;
@@ -464,44 +473,11 @@ static void evaluateInScope(const v8::FunctionCallbackInfo<v8::Value>& args)
} else {
target = DartHandleProxy::unwrapValue(receiver);
}
+
ASSERT(!Dart_IsError(target));
Dart_Handle localVariables = DartHandleProxy::unwrapValue(localVariablesProxy);
- ASSERT(Dart_IsList(localVariables));
- intptr_t localVariablesLength = 0;
- Dart_ListLength(localVariables, &localVariablesLength);
-
- Dart_Handle wrapExpressionArgs[2] = { V8Converter::stringToDart(expression), localVariables };
-
- Dart_Handle wrappedExpressionTuple =
- DartUtilities::invokeUtilsMethod("wrapExpressionAsClosure", 2, wrapExpressionArgs);
- ASSERT(Dart_IsList(wrappedExpressionTuple));
- Dart_Handle wrappedExpression = Dart_ListGetAt(wrappedExpressionTuple, 0);
- Dart_Handle wrappedExpressionArgs = Dart_ListGetAt(wrappedExpressionTuple, 1);
-
- ASSERT(Dart_IsString(wrappedExpression));
- Dart_Handle closure = Dart_EvaluateExpr(target, wrappedExpression);
- if (Dart_IsError(closure)) {
- // There was a parse error. FIXME: consider cleaning up the line
- // numbers in the error message.
- V8ThrowException::throwError(v8::String::New(Dart_GetError(closure)));
- } else {
- // Invoke the closure passing in the expression arguments specified by
- // wrappedExpressionTuple.
- ASSERT(Dart_IsClosure(closure));
- intptr_t length = 0;
- Dart_ListLength(wrappedExpressionArgs, &length);
- Vector<Dart_Handle> dartFunctionArgs;
- for (uint32_t i = 0; i < length; i ++) {
- dartFunctionArgs.append(Dart_ListGetAt(wrappedExpressionArgs, i));
- }
- Dart_Handle result = Dart_InvokeClosure(closure, dartFunctionArgs.size(), dartFunctionArgs.data());
- if (Dart_IsError(result)) {
- V8ThrowException::throwError(v8::String::New(Dart_GetError(result)));
- } else {
- v8SetReturnValue(args, DartHandleProxy::create(result));
- }
- }
+ v8SetReturnValue(args, DartHandleProxy::evaluate(target, V8Converter::stringToDart(expression), localVariables));
}
void DartDebugServer::ensureHooksInstalled()
« no previous file with comments | « Source/bindings/dart/DartDebugHooks.js ('k') | Source/bindings/dart/DartHandleProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698