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

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

Issue 19064004: Support re-reading scope variables in protocol and on backed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: follow code review Created 7 years, 5 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
« no previous file with comments | « Source/core/inspector/InjectedScript.h ('k') | Source/core/inspector/InjectedScriptExterns.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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 *errorString = "Internal error"; 135 *errorString = "Internal error";
136 return; 136 return;
137 } 137 }
138 if (resultValue->type() == JSONValue::TypeString) { 138 if (resultValue->type() == JSONValue::TypeString) {
139 resultValue->asString(errorString); 139 resultValue->asString(errorString);
140 return; 140 return;
141 } 141 }
142 // Normal return. 142 // Normal return.
143 } 143 }
144 144
145 void InjectedScript::getCallFrameScopes(ErrorString* errorString, const ScriptVa lue& callFrames, const String& callFrameId, RefPtr<TypeBuilder::Array<TypeBuilde r::Debugger::Scope> >* result)
146 {
147 ScriptFunctionCall function(injectedScriptObject(), "getCallFrameScopes");
148 function.appendArgument(callFrames);
149 function.appendArgument(callFrameId);
150 RefPtr<JSONValue> resultValue;
151 makeCall(function, &resultValue);
152 if (!resultValue || resultValue->type() != JSONValue::TypeArray) {
153 if (!resultValue->asString(errorString))
154 *errorString = "Internal error";
155 return;
156 }
157 *result = TypeBuilder::Array<TypeBuilder::Debugger::Scope>::runtimeCast(resu ltValue);
158 }
159
160
145 void InjectedScript::getFunctionDetails(ErrorString* errorString, const String& functionId, RefPtr<FunctionDetails>* result) 161 void InjectedScript::getFunctionDetails(ErrorString* errorString, const String& functionId, RefPtr<FunctionDetails>* result)
146 { 162 {
147 ScriptFunctionCall function(injectedScriptObject(), "getFunctionDetails"); 163 ScriptFunctionCall function(injectedScriptObject(), "getFunctionDetails");
148 function.appendArgument(functionId); 164 function.appendArgument(functionId);
149 RefPtr<JSONValue> resultValue; 165 RefPtr<JSONValue> resultValue;
150 makeCall(function, &resultValue); 166 makeCall(function, &resultValue);
151 if (!resultValue || resultValue->type() != JSONValue::TypeObject) { 167 if (!resultValue || resultValue->type() != JSONValue::TypeObject) {
152 if (!resultValue->asString(errorString)) 168 if (!resultValue->asString(errorString))
153 *errorString = "Internal error"; 169 *errorString = "Internal error";
154 return; 170 return;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 ASSERT(!hadException); 311 ASSERT(!hadException);
296 } 312 }
297 313
298 ScriptValue InjectedScript::nodeAsScriptValue(Node* node) 314 ScriptValue InjectedScript::nodeAsScriptValue(Node* node)
299 { 315 {
300 return InjectedScriptHost::nodeAsScriptValue(scriptState(), node); 316 return InjectedScriptHost::nodeAsScriptValue(scriptState(), node);
301 } 317 }
302 318
303 } // namespace WebCore 319 } // namespace WebCore
304 320
OLDNEW
« no previous file with comments | « Source/core/inspector/InjectedScript.h ('k') | Source/core/inspector/InjectedScriptExterns.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698