Changeset 116099 in webkit
- Timestamp:
- May 4, 2012 7:36:43 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116098 r116099 1 2012-05-04 Yury Semikhatsky <yurys@chromium.org> 2 3 Web Inspector: use single method for retrieving evaluation context in the runtime agent 4 https://bugs.webkit.org/show_bug.cgi?id=85621 5 6 Reviewed by Pavel Feldman. 7 8 Merged two script state retrieval methods into one. Moved Page specific logic 9 into PageRuntimeAgent. 10 11 * inspector/InspectorRuntimeAgent.cpp: 12 (WebCore::InspectorRuntimeAgent::evaluate): 13 * inspector/InspectorRuntimeAgent.h: 14 (InspectorRuntimeAgent): 15 * inspector/PageRuntimeAgent.cpp: 16 (WebCore::PageRuntimeAgent::scriptStateForEval): 17 * inspector/PageRuntimeAgent.h: 18 (PageRuntimeAgent): 19 * inspector/WorkerRuntimeAgent.cpp: 20 (WebCore::WorkerRuntimeAgent::scriptStateForEval): 21 * inspector/WorkerRuntimeAgent.h: 22 (WorkerRuntimeAgent): 23 1 24 2012-05-04 Jochen Eisinger <jochen@chromium.org> 2 25 -
trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp
r114632 r116099 86 86 void InspectorRuntimeAgent::evaluate(ErrorString* errorString, const String& expression, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptionsAndMuteConsole, const String* const frameId, const bool* const returnByValue, RefPtr<TypeBuilder::Runtime::RemoteObject>& result, TypeBuilder::OptOutput<bool>* wasThrown) 87 87 { 88 ScriptState* scriptState = 0; 89 if (frameId) { 90 scriptState = scriptStateForFrameId(*frameId); 91 if (!scriptState) { 92 *errorString = "Frame with given id not found."; 93 return; 94 } 95 } else 96 scriptState = getDefaultInspectedState(); 88 ScriptState* scriptState = scriptStateForEval(errorString, frameId); 89 if (!scriptState) 90 return; 97 91 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(scriptState); 98 92 if (injectedScript.hasNoValue()) { -
trunk/Source/WebCore/inspector/InspectorRuntimeAgent.h
r114632 r116099 89 89 protected: 90 90 InspectorRuntimeAgent(InstrumentingAgents*, InspectorState*, InjectedScriptManager*); 91 virtual ScriptState* scriptStateFor FrameId(const String&frameId) = 0;92 virtual ScriptState* getDefaultInspectedState() = 0; 91 virtual ScriptState* scriptStateForEval(ErrorString*, const String* frameId) = 0; 92 93 93 virtual void muteConsole() = 0; 94 94 virtual void unmuteConsole() = 0; -
trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp
r114632 r116099 53 53 } 54 54 55 ScriptState* PageRuntimeAgent::scriptStateFor FrameId(const String&frameId)55 ScriptState* PageRuntimeAgent::scriptStateForEval(ErrorString* errorString, const String* frameId) 56 56 { 57 Frame* frame = m_pageAgent->frameForId(frameId); 58 if (!frame) 57 if (!frameId) 58 return mainWorldScriptState(m_inspectedPage->mainFrame()); 59 60 Frame* frame = m_pageAgent->frameForId(*frameId); 61 if (!frame) { 62 *errorString = "Frame with given id not found."; 59 63 return 0; 64 } 60 65 return mainWorldScriptState(frame); 61 }62 63 ScriptState* PageRuntimeAgent::getDefaultInspectedState()64 {65 return mainWorldScriptState(m_inspectedPage->mainFrame());66 66 } 67 67 -
trunk/Source/WebCore/inspector/PageRuntimeAgent.h
r114632 r116099 53 53 PageRuntimeAgent(InstrumentingAgents*, InspectorState*, InjectedScriptManager*, Page*, InspectorPageAgent*); 54 54 55 virtual ScriptState* scriptStateForFrameId(const String& frameId); 56 virtual ScriptState* getDefaultInspectedState(); 55 virtual ScriptState* scriptStateForEval(ErrorString*, const String* frameId); 57 56 virtual void muteConsole(); 58 57 virtual void unmuteConsole(); -
trunk/Source/WebCore/inspector/WorkerRuntimeAgent.cpp
r114632 r116099 49 49 } 50 50 51 ScriptState* WorkerRuntimeAgent::scriptStateFor FrameId(const String&)51 ScriptState* WorkerRuntimeAgent::scriptStateForEval(ErrorString* error, const String* frameId) 52 52 { 53 return 0; 54 } 55 56 ScriptState* WorkerRuntimeAgent::getDefaultInspectedState() 57 { 53 if (frameId) { 54 *error = "Frame id is not supported for workers."; 55 return 0; 56 } 58 57 return scriptStateFromWorkerContext(m_workerContext); 59 58 } -
trunk/Source/WebCore/inspector/WorkerRuntimeAgent.h
r114632 r116099 51 51 private: 52 52 WorkerRuntimeAgent(InstrumentingAgents*, InspectorState*, InjectedScriptManager*, WorkerContext*); 53 virtual ScriptState* scriptStateForFrameId(const String& frameId); 54 virtual ScriptState* getDefaultInspectedState(); 53 virtual ScriptState* scriptStateForEval(ErrorString*, const String* frameId); 55 54 virtual void muteConsole(); 56 55 virtual void unmuteConsole();
Note: See TracChangeset
for help on using the changeset viewer.