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

Side by Side Diff: Source/core/inspector/InjectedScript.cpp

Issue 136333007: DevTools: Implement evaluation on async call frames. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/InjectedScript.h ('k') | Source/core/inspector/InjectedScriptSource.js » ('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 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 { 72 {
73 ScriptFunctionCall function(injectedScriptObject(), "callFunctionOn"); 73 ScriptFunctionCall function(injectedScriptObject(), "callFunctionOn");
74 function.appendArgument(objectId); 74 function.appendArgument(objectId);
75 function.appendArgument(expression); 75 function.appendArgument(expression);
76 function.appendArgument(arguments); 76 function.appendArgument(arguments);
77 function.appendArgument(returnByValue); 77 function.appendArgument(returnByValue);
78 function.appendArgument(generatePreview); 78 function.appendArgument(generatePreview);
79 makeEvalCall(errorString, function, result, wasThrown); 79 makeEvalCall(errorString, function, result, wasThrown);
80 } 80 }
81 81
82 void InjectedScript::evaluateOnCallFrame(ErrorString* errorString, const ScriptV alue& callFrames, const String& callFrameId, const String& expression, const Str ing& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generateP review, RefPtr<RemoteObject>* result, TypeBuilder::OptOutput<bool>* wasThrown) 82 void InjectedScript::evaluateOnCallFrame(ErrorString* errorString, const ScriptV alue& callFrames, const Vector<ScriptValue>& asyncCallStacks, const String& call FrameId, const String& expression, const String& objectGroup, bool includeComman dLineAPI, bool returnByValue, bool generatePreview, RefPtr<RemoteObject>* result , TypeBuilder::OptOutput<bool>* wasThrown)
83 { 83 {
84 ScriptFunctionCall function(injectedScriptObject(), "evaluateOnCallFrame"); 84 ScriptFunctionCall function(injectedScriptObject(), "evaluateOnCallFrame");
85 function.appendArgument(callFrames); 85 function.appendArgument(callFrames);
86 function.appendArgument(asyncCallStacks);
86 function.appendArgument(callFrameId); 87 function.appendArgument(callFrameId);
87 function.appendArgument(expression); 88 function.appendArgument(expression);
88 function.appendArgument(objectGroup); 89 function.appendArgument(objectGroup);
89 function.appendArgument(includeCommandLineAPI); 90 function.appendArgument(includeCommandLineAPI);
90 function.appendArgument(returnByValue); 91 function.appendArgument(returnByValue);
91 function.appendArgument(generatePreview); 92 function.appendArgument(generatePreview);
92 makeEvalCall(errorString, function, result, wasThrown); 93 makeEvalCall(errorString, function, result, wasThrown);
93 } 94 }
94 95
95 void InjectedScript::restartFrame(ErrorString* errorString, const ScriptValue& c allFrames, const String& callFrameId, RefPtr<JSONObject>* result) 96 void InjectedScript::restartFrame(ErrorString* errorString, const ScriptValue& c allFrames, const String& callFrameId, RefPtr<JSONObject>* result)
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 225 }
225 226
226 void InjectedScript::releaseObject(const String& objectId) 227 void InjectedScript::releaseObject(const String& objectId)
227 { 228 {
228 ScriptFunctionCall function(injectedScriptObject(), "releaseObject"); 229 ScriptFunctionCall function(injectedScriptObject(), "releaseObject");
229 function.appendArgument(objectId); 230 function.appendArgument(objectId);
230 RefPtr<JSONValue> result; 231 RefPtr<JSONValue> result;
231 makeCall(function, &result); 232 makeCall(function, &result);
232 } 233 }
233 234
234 PassRefPtr<Array<CallFrame> > InjectedScript::wrapCallFrames(const ScriptValue& callFrames) 235 PassRefPtr<Array<CallFrame> > InjectedScript::wrapCallFrames(const ScriptValue& callFrames, int asyncOrdinal)
235 { 236 {
236 ASSERT(!hasNoValue()); 237 ASSERT(!hasNoValue());
237 ScriptFunctionCall function(injectedScriptObject(), "wrapCallFrames"); 238 ScriptFunctionCall function(injectedScriptObject(), "wrapCallFrames");
238 function.appendArgument(callFrames); 239 function.appendArgument(callFrames);
240 function.appendArgument(asyncOrdinal);
239 bool hadException = false; 241 bool hadException = false;
240 ScriptValue callFramesValue = callFunctionWithEvalEnabled(function, hadExcep tion); 242 ScriptValue callFramesValue = callFunctionWithEvalEnabled(function, hadExcep tion);
241 ASSERT(!hadException); 243 ASSERT(!hadException);
242 RefPtr<JSONValue> result = callFramesValue.toJSONValue(scriptState()); 244 RefPtr<JSONValue> result = callFramesValue.toJSONValue(scriptState());
243 if (result->type() == JSONValue::TypeArray) 245 if (result->type() == JSONValue::TypeArray)
244 return Array<CallFrame>::runtimeCast(result); 246 return Array<CallFrame>::runtimeCast(result);
245 return Array<CallFrame>::create(); 247 return Array<CallFrame>::create();
246 } 248 }
247 249
248 PassRefPtr<TypeBuilder::Runtime::RemoteObject> InjectedScript::wrapObject(const ScriptValue& value, const String& groupName, bool generatePreview) const 250 PassRefPtr<TypeBuilder::Runtime::RemoteObject> InjectedScript::wrapObject(const ScriptValue& value, const String& groupName, bool generatePreview) const
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 ASSERT(!hadException); 332 ASSERT(!hadException);
331 } 333 }
332 334
333 ScriptValue InjectedScript::nodeAsScriptValue(Node* node) 335 ScriptValue InjectedScript::nodeAsScriptValue(Node* node)
334 { 336 {
335 return InjectedScriptHost::nodeAsScriptValue(scriptState(), node); 337 return InjectedScriptHost::nodeAsScriptValue(scriptState(), node);
336 } 338 }
337 339
338 } // namespace WebCore 340 } // namespace WebCore
339 341
OLDNEW
« no previous file with comments | « Source/core/inspector/InjectedScript.h ('k') | Source/core/inspector/InjectedScriptSource.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698