Changeset 126140 in webkit
- Timestamp:
- Aug 21, 2012 12:24:05 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r126139 r126140 1 2012-08-21 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r126028. 4 http://trac.webkit.org/changeset/126028 5 https://bugs.webkit.org/show_bug.cgi?id=94576 6 7 it broke compilation on apple webkit win. (Requested by loislo 8 on #webkit). 9 10 * inspector/CodeGeneratorInspector.py: 11 * inspector/InjectedScriptWebGLModule.cpp: 12 (WebCore::InjectedScriptWebGLModule::captureFrame): 13 * inspector/InjectedScriptWebGLModule.h: 14 (InjectedScriptWebGLModule): 15 * inspector/Inspector.json: 16 * inspector/InspectorController.cpp: 17 (WebCore::InspectorController::InspectorController): 18 * inspector/InspectorWebGLAgent.cpp: 19 (WebCore::InspectorWebGLAgent::InspectorWebGLAgent): 20 * inspector/InspectorWebGLAgent.h: 21 (WebCore): 22 (WebCore::InspectorWebGLAgent::create): 23 (InspectorWebGLAgent): 24 1 25 2012-08-20 Ilya Tikhonovsky <loislo@chromium.org> 2 26 -
trunk/Source/WebCore/inspector/CodeGeneratorInspector.py
r126028 r126140 59 59 60 60 TYPES_WITH_RUNTIME_CAST_SET = frozenset(["Runtime.RemoteObject", "Runtime.PropertyDescriptor", 61 "Debugger.FunctionDetails", "Debugger.CallFrame", "WebGL.TraceLog",61 "Debugger.FunctionDetails", "Debugger.CallFrame", 62 62 # This should be a temporary hack. TimelineEvent should be created via generated C++ API. 63 63 "Timeline.TimelineEvent"]) -
trunk/Source/WebCore/inspector/InjectedScriptWebGLModule.cpp
r126028 r126140 73 73 } 74 74 75 void InjectedScriptWebGLModule::captureFrame(ErrorString* errorString, String* traceLogId)75 void InjectedScriptWebGLModule::captureFrame(ErrorString* errorString, const String& contextId) 76 76 { 77 77 ScriptFunctionCall function(injectedScriptObject(), "captureFrame"); 78 RefPtr<InspectorValue> resultValue; 79 makeCall(function, &resultValue); 80 if (!resultValue || resultValue->type() != InspectorValue::TypeString || !resultValue->asString(traceLogId)) 81 *errorString = "Internal error: captureFrame"; 82 } 83 84 void InjectedScriptWebGLModule::dropTraceLog(ErrorString* errorString, const String& traceLogId) 85 { 86 ScriptFunctionCall function(injectedScriptObject(), "dropTraceLog"); 87 function.appendArgument(traceLogId); 78 function.appendArgument(contextId); 88 79 bool hadException = false; 89 80 callFunctionWithEvalEnabled(function, hadException); 90 81 ASSERT(!hadException); 91 82 if (hadException) 92 *errorString = "Internal error: dropTraceLog"; 93 } 94 95 void InjectedScriptWebGLModule::traceLog(ErrorString* errorString, const String& traceLogId, RefPtr<TypeBuilder::WebGL::TraceLog>* traceLog) 96 { 97 ScriptFunctionCall function(injectedScriptObject(), "traceLog"); 98 function.appendArgument(traceLogId); 99 RefPtr<InspectorValue> resultValue; 100 makeCall(function, &resultValue); 101 if (!resultValue || resultValue->type() != InspectorValue::TypeObject) { 102 if (!resultValue->asString(errorString)) 103 *errorString = "Internal error: traceLog"; 104 return; 105 } 106 *traceLog = TypeBuilder::WebGL::TraceLog::runtimeCast(resultValue); 107 } 108 109 void InjectedScriptWebGLModule::replayTraceLog(ErrorString* errorString, const String& traceLogId, int stepNo, String* result) 110 { 111 ScriptFunctionCall function(injectedScriptObject(), "replayTraceLog"); 112 function.appendArgument(traceLogId); 113 function.appendArgument(stepNo); 114 RefPtr<InspectorValue> resultValue; 115 makeCall(function, &resultValue); 116 if (!resultValue || resultValue->type() != InspectorValue::TypeString || !resultValue->asString(result)) 117 *errorString = "Internal error: replayTraceLog"; 83 *errorString = "Internal error"; 118 84 } 119 85 -
trunk/Source/WebCore/inspector/InjectedScriptWebGLModule.h
r126028 r126140 45 45 class InjectedScriptWebGLModule : public InjectedScriptModule { 46 46 public: 47 InjectedScriptWebGLModule();48 49 47 virtual String source() const; 50 48 … … 52 50 53 51 ScriptObject wrapWebGLContext(const ScriptObject& glContext); 54 void captureFrame(ErrorString*, String*);55 void dropTraceLog(ErrorString*, const String&); 56 void traceLog(ErrorString*, const String&, RefPtr<TypeBuilder::WebGL::TraceLog>*); 57 void replayTraceLog(ErrorString*, const String&, int, String*);52 void captureFrame(ErrorString*, const String& contextId); 53 54 private: 55 InjectedScriptWebGLModule(); 58 56 }; 59 57 -
trunk/Source/WebCore/inspector/Inspector.json
r126028 r126140 3118 3118 "domain": "WebGL", 3119 3119 "hidden": true, 3120 "types": [ 3121 { 3122 "id": "TraceLogId", 3123 "type": "string", 3124 "description": "Unique object identifier." 3125 }, 3126 { 3127 "id": "Call", 3128 "type": "object", 3129 "properties": [ 3130 { "name": "functionName", "type": "string" } 3131 ] 3132 }, 3133 { 3134 "id": "TraceLog", 3135 "type": "object", 3136 "properties": [ 3137 { "name": "id", "$ref": "TraceLogId" }, 3138 { "name": "calls", "type": "array", "items": { "$ref": "Call" }} 3139 ] 3140 } 3141 ], 3120 "types": [], 3142 3121 "commands": [ 3143 3122 { … … 3148 3127 "name": "disable", 3149 3128 "description": "Disables WebGL inspection." 3150 },3151 {3152 "name": "dropTraceLog",3153 "parameters": [3154 { "name": "traceLogId", "$ref": "TraceLogId" }3155 ]3156 },3157 {3158 "name": "captureFrame",3159 "returns": [3160 { "name": "traceLogId", "$ref": "TraceLogId" }3161 ]3162 },3163 {3164 "name": "getTraceLog",3165 "parameters": [3166 { "name": "traceLogId", "$ref": "TraceLogId" }3167 ],3168 "returns": [3169 { "name": "traceLog", "$ref": "TraceLog" }3170 ]3171 },3172 {3173 "name": "replayTraceLog",3174 "parameters": [3175 { "name": "traceLogId", "$ref": "TraceLogId" },3176 { "name": "stepNo", "type": "integer" }3177 ],3178 "returns": [3179 { "name": "screenshotDataUrl", "type": "string" }3180 ]3181 3129 } 3182 3130 ], -
trunk/Source/WebCore/inspector/InspectorController.cpp
r126028 r126140 149 149 150 150 #if ENABLE(WEBGL) 151 m_agents.append(InspectorWebGLAgent::create(m_instrumentingAgents.get(), m_state.get(), page,m_injectedScriptManager.get()));151 m_agents.append(InspectorWebGLAgent::create(m_instrumentingAgents.get(), m_state.get(), m_injectedScriptManager.get())); 152 152 #endif 153 153 -
trunk/Source/WebCore/inspector/InspectorWebGLAgent.cpp
r126028 r126140 35 35 #include "InspectorWebGLAgent.h" 36 36 37 #include "InjectedScript.h"38 37 #include "InjectedScriptManager.h" 39 38 #include "InjectedScriptWebGLModule.h" … … 41 40 #include "InspectorState.h" 42 41 #include "InstrumentingAgents.h" 43 #include "Page.h"44 42 #include "ScriptObject.h" 45 43 #include "ScriptState.h" … … 51 49 }; 52 50 53 InspectorWebGLAgent::InspectorWebGLAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page,InjectedScriptManager* injectedScriptManager)51 InspectorWebGLAgent::InspectorWebGLAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, InjectedScriptManager* injectedScriptManager) 54 52 : InspectorBaseAgent<InspectorWebGLAgent>("WebGL", instrumentingAgents, state) 55 , m_inspectedPage(page)56 53 , m_injectedScriptManager(injectedScriptManager) 57 54 , m_frontend(0) … … 99 96 } 100 97 101 void InspectorWebGLAgent::dropTraceLog(ErrorString* errorString, const String& traceLogId)102 {103 InjectedScriptWebGLModule module = injectedScriptWebGLModuleForTraceLogId(errorString, traceLogId);104 if (!module.hasNoValue())105 module.dropTraceLog(errorString, traceLogId);106 }107 108 void InspectorWebGLAgent::captureFrame(ErrorString* errorString, String* traceLogId)109 {110 ScriptState* scriptState = mainWorldScriptState(m_inspectedPage->mainFrame());111 InjectedScriptWebGLModule module = InjectedScriptWebGLModule::moduleForState(m_injectedScriptManager, scriptState);112 if (module.hasNoValue()) {113 *errorString = "Inspected frame has gone";114 return;115 }116 module.captureFrame(errorString, traceLogId);117 }118 119 void InspectorWebGLAgent::getTraceLog(ErrorString* errorString, const String& traceLogId, RefPtr<TypeBuilder::WebGL::TraceLog>& traceLog)120 {121 InjectedScriptWebGLModule module = injectedScriptWebGLModuleForTraceLogId(errorString, traceLogId);122 if (!module.hasNoValue())123 module.traceLog(errorString, traceLogId, &traceLog);124 }125 126 void InspectorWebGLAgent::replayTraceLog(ErrorString* errorString, const String& traceLogId, int stepNo, String* result)127 {128 InjectedScriptWebGLModule module = injectedScriptWebGLModuleForTraceLogId(errorString, traceLogId);129 if (!module.hasNoValue())130 module.replayTraceLog(errorString, traceLogId, stepNo, result);131 }132 133 98 ScriptObject InspectorWebGLAgent::wrapWebGLRenderingContextForInstrumentation(const ScriptObject& glContext) 134 99 { … … 145 110 } 146 111 147 InjectedScriptWebGLModule InspectorWebGLAgent::injectedScriptWebGLModuleForTraceLogId(ErrorString* errorString, const String& traceLogId)148 {149 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(traceLogId);150 if (injectedScript.hasNoValue()) {151 *errorString = "Inspected frame has gone";152 return InjectedScriptWebGLModule();153 }154 InjectedScriptWebGLModule module = InjectedScriptWebGLModule::moduleForState(m_injectedScriptManager, injectedScript.scriptState());155 if (module.hasNoValue()) {156 ASSERT_NOT_REACHED();157 *errorString = "Internal error: no WebGL module";158 return InjectedScriptWebGLModule();159 }160 return module;161 }162 163 112 } // namespace WebCore 164 113 -
trunk/Source/WebCore/inspector/InspectorWebGLAgent.h
r126028 r126140 36 36 #include "InspectorBaseAgent.h" 37 37 #include "InspectorFrontend.h" 38 #include "InspectorTypeBuilder.h"39 38 #include "PlatformString.h" 40 39 #include "ScriptState.h" … … 45 44 46 45 class InjectedScriptManager; 47 class InjectedScriptWebGLModule;48 46 class InspectorState; 49 47 class InstrumentingAgents; 50 class Page;51 48 class ScriptObject; 52 49 … … 55 52 class InspectorWebGLAgent : public InspectorBaseAgent<InspectorWebGLAgent>, public InspectorBackendDispatcher::WebGLCommandHandler { 56 53 public: 57 static PassOwnPtr<InspectorWebGLAgent> create(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page,InjectedScriptManager* injectedScriptManager)54 static PassOwnPtr<InspectorWebGLAgent> create(InstrumentingAgents* instrumentingAgents, InspectorState* state, InjectedScriptManager* injectedScriptManager) 58 55 { 59 return adoptPtr(new InspectorWebGLAgent(instrumentingAgents, state, page,injectedScriptManager));56 return adoptPtr(new InspectorWebGLAgent(instrumentingAgents, state, injectedScriptManager)); 60 57 } 61 58 ~InspectorWebGLAgent(); … … 72 69 virtual void enable(ErrorString*); 73 70 virtual void disable(ErrorString*); 74 virtual void dropTraceLog(ErrorString*, const String&);75 virtual void captureFrame(ErrorString*, String*);76 virtual void getTraceLog(ErrorString*, const String&, RefPtr<TypeBuilder::WebGL::TraceLog>&);77 virtual void replayTraceLog(ErrorString*, const String&, int, String*);78 71 79 72 // Called from the injected script. … … 82 75 83 76 private: 84 InspectorWebGLAgent(InstrumentingAgents*, InspectorState*, Page*,InjectedScriptManager*);77 InspectorWebGLAgent(InstrumentingAgents*, InspectorState*, InjectedScriptManager*); 85 78 86 InjectedScriptWebGLModule injectedScriptWebGLModuleForTraceLogId(ErrorString*, const String&);87 88 Page* m_inspectedPage;89 79 InjectedScriptManager* m_injectedScriptManager; 90 80 InspectorFrontend::WebGL* m_frontend;
Note: See TracChangeset
for help on using the changeset viewer.