Changeset 120929 in webkit
- Timestamp:
- Jun 21, 2012 9:53:57 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 12 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r120893 r120929 931 931 inspector/DOMPatchSupport.cpp 932 932 inspector/IdentifiersFactory.cpp 933 inspector/InjectedScriptModule.cpp934 933 inspector/InjectedScript.cpp 935 934 inspector/InjectedScriptBase.cpp 936 935 inspector/InjectedScriptHost.cpp 937 936 inspector/InjectedScriptManager.cpp 937 inspector/InjectedScriptModule.cpp 938 inspector/InjectedScriptWebGLModule.cpp 938 939 inspector/InspectorAgent.cpp 939 940 inspector/InspectorApplicationCacheAgent.cpp -
trunk/Source/WebCore/ChangeLog
r120928 r120929 1 2012-06-21 Andrey Adaikin <aandrey@chromium.org> 2 3 Web Inspector: [WebGL] Add injected WebGL module class 4 https://bugs.webkit.org/show_bug.cgi?id=89592 5 6 Reviewed by Pavel Feldman. 7 8 Adding a new InjectedScriptWebGLModule class and moving WebGL-related 9 stuff out of InjectedScriptManager class. 10 11 * CMakeLists.txt: 12 * GNUmakefile.list.am: 13 * Target.pri: 14 * WebCore.gypi: 15 * WebCore.vcproj/WebCore.vcproj: 16 * WebCore.xcodeproj/project.pbxproj: 17 * inspector/InjectedScriptManager.cpp: 18 * inspector/InjectedScriptManager.h: 19 (InjectedScriptManager): 20 * inspector/InjectedScriptModule.cpp: 21 (WebCore::InjectedScriptModule::ensureInjected): 22 * inspector/InjectedScriptModule.h: 23 (InjectedScriptModule): 24 * inspector/InjectedScriptWebGLModule.cpp: Copied from Source/WebCore/inspector/InjectedScriptModule.cpp. 25 (WebCore): 26 (WebCore::InjectedScriptWebGLModule::InjectedScriptWebGLModule): 27 (WebCore::InjectedScriptWebGLModule::moduleForState): 28 (WebCore::InjectedScriptWebGLModule::source): 29 (WebCore::InjectedScriptWebGLModule::wrapWebGLContext): 30 (WebCore::InjectedScriptWebGLModule::captureFrame): 31 * inspector/InjectedScriptWebGLModule.h: Copied from Source/WebCore/inspector/InjectedScriptModule.h. 32 (WebCore): 33 (InjectedScriptWebGLModule): 34 * inspector/InspectorWebGLAgent.cpp: 35 (WebCore::InspectorWebGLAgent::wrapWebGLRenderingContextForInstrumentation): 36 1 37 2012-06-21 Pavel Feldman <pfeldman@chromium.org> 2 38 -
trunk/Source/WebCore/GNUmakefile.list.am
r120893 r120929 2654 2654 Source/WebCore/inspector/IdentifiersFactory.cpp \ 2655 2655 Source/WebCore/inspector/IdentifiersFactory.h \ 2656 Source/WebCore/inspector/InjectedScriptModule.cpp \2657 Source/WebCore/inspector/InjectedScriptModule.h \2658 2656 Source/WebCore/inspector/InjectedScript.cpp \ 2659 2657 Source/WebCore/inspector/InjectedScript.h \ … … 2664 2662 Source/WebCore/inspector/InjectedScriptManager.cpp \ 2665 2663 Source/WebCore/inspector/InjectedScriptManager.h \ 2664 Source/WebCore/inspector/InjectedScriptModule.cpp \ 2665 Source/WebCore/inspector/InjectedScriptModule.h \ 2666 Source/WebCore/inspector/InjectedScriptWebGLModule.cpp \ 2667 Source/WebCore/inspector/InjectedScriptWebGLModule.h \ 2666 2668 Source/WebCore/inspector/InspectorAgent.cpp \ 2667 2669 Source/WebCore/inspector/InspectorAgent.h \ -
trunk/Source/WebCore/Target.pri
r120893 r120929 891 891 inspector/DOMPatchSupport.cpp \ 892 892 inspector/IdentifiersFactory.cpp \ 893 inspector/InjectedScriptModule.cpp \894 893 inspector/InjectedScript.cpp \ 895 894 inspector/InjectedScriptBase.cpp \ 896 895 inspector/InjectedScriptHost.cpp \ 897 896 inspector/InjectedScriptManager.cpp \ 897 inspector/InjectedScriptModule.cpp \ 898 inspector/InjectedScriptWebGLModule.cpp \ 898 899 inspector/InspectorAgent.cpp \ 899 900 inspector/InspectorApplicationCacheAgent.cpp \ … … 2041 2042 inspector/DOMWrapperVisitor.h \ 2042 2043 inspector/IdentifiersFactory.h \ 2043 inspector/InjectedScriptModule.h \2044 2044 inspector/InjectedScript.h \ 2045 2045 inspector/InjectedScriptBase.h \ 2046 2046 inspector/InjectedScriptHost.h \ 2047 2047 inspector/InjectedScriptManager.h \ 2048 inspector/InjectedScriptModule.h \ 2049 inspector/InjectedScriptWebGLModule.h \ 2048 2050 inspector/InspectorAgent.h \ 2049 2051 inspector/InspectorApplicationCacheAgent.h \ -
trunk/Source/WebCore/WebCore.gypi
r120893 r120929 2767 2767 'inspector/IdentifiersFactory.cpp', 2768 2768 'inspector/IdentifiersFactory.h', 2769 'inspector/InjectedScriptModule.cpp',2770 'inspector/InjectedScriptModule.h',2771 2769 'inspector/InjectedScript.cpp', 2772 2770 'inspector/InjectedScript.h', … … 2777 2775 'inspector/InjectedScriptManager.cpp', 2778 2776 'inspector/InjectedScriptManager.h', 2777 'inspector/InjectedScriptModule.cpp', 2778 'inspector/InjectedScriptModule.h', 2779 'inspector/InjectedScriptWebGLModule.cpp', 2780 'inspector/InjectedScriptWebGLModule.h', 2779 2781 'inspector/InspectorAgent.cpp', 2780 2782 'inspector/InspectorApplicationCacheAgent.cpp', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r120893 r120929 73316 73316 </File> 73317 73317 <File 73318 RelativePath="..\inspector\InjectedScript.cpp" 73319 > 73320 <FileConfiguration 73321 Name="Release|Win32" 73322 ExcludedFromBuild="true" 73323 > 73324 <Tool 73325 Name="VCCLCompilerTool" 73326 /> 73327 </FileConfiguration> 73328 <FileConfiguration 73329 Name="Production|Win32" 73330 ExcludedFromBuild="true" 73331 > 73332 <Tool 73333 Name="VCCLCompilerTool" 73334 /> 73335 </FileConfiguration> 73336 </File> 73337 <File 73338 RelativePath="..\inspector\InjectedScript.h" 73339 > 73340 </File> 73341 <File 73342 RelativePath="..\inspector\InjectedScriptBase.cpp" 73343 > 73344 <FileConfiguration 73345 Name="Release|Win32" 73346 ExcludedFromBuild="true" 73347 > 73348 <Tool 73349 Name="VCCLCompilerTool" 73350 /> 73351 </FileConfiguration> 73352 <FileConfiguration 73353 Name="Production|Win32" 73354 ExcludedFromBuild="true" 73355 > 73356 <Tool 73357 Name="VCCLCompilerTool" 73358 /> 73359 </FileConfiguration> 73360 </File> 73361 <File 73362 RelativePath="..\inspector\InjectedScriptBase.h" 73363 > 73364 </File> 73365 <File 73366 RelativePath="..\inspector\InjectedScriptHost.cpp" 73367 > 73368 <FileConfiguration 73369 Name="Release|Win32" 73370 ExcludedFromBuild="true" 73371 > 73372 <Tool 73373 Name="VCCLCompilerTool" 73374 /> 73375 </FileConfiguration> 73376 <FileConfiguration 73377 Name="Production|Win32" 73378 ExcludedFromBuild="true" 73379 > 73380 <Tool 73381 Name="VCCLCompilerTool" 73382 /> 73383 </FileConfiguration> 73384 </File> 73385 <File 73386 RelativePath="..\inspector\InjectedScriptHost.h" 73387 > 73388 </File> 73389 <File 73390 RelativePath="..\inspector\InjectedScriptManager.cpp" 73391 > 73392 <FileConfiguration 73393 Name="Release|Win32" 73394 ExcludedFromBuild="true" 73395 > 73396 <Tool 73397 Name="VCCLCompilerTool" 73398 /> 73399 </FileConfiguration> 73400 <FileConfiguration 73401 Name="Production|Win32" 73402 ExcludedFromBuild="true" 73403 > 73404 <Tool 73405 Name="VCCLCompilerTool" 73406 /> 73407 </FileConfiguration> 73408 </File> 73409 <File 73410 RelativePath="..\inspector\InjectedScriptManager.h" 73411 > 73412 </File> 73413 <File 73318 73414 RelativePath="..\inspector\InjectedScriptModule.cpp" 73319 73415 > … … 73340 73436 </File> 73341 73437 <File 73342 RelativePath="..\inspector\InjectedScript.cpp" 73343 > 73344 <FileConfiguration 73345 Name="Release|Win32" 73346 ExcludedFromBuild="true" 73347 > 73348 <Tool 73349 Name="VCCLCompilerTool" 73350 /> 73351 </FileConfiguration> 73352 <FileConfiguration 73353 Name="Production|Win32" 73354 ExcludedFromBuild="true" 73355 > 73356 <Tool 73357 Name="VCCLCompilerTool" 73358 /> 73359 </FileConfiguration> 73360 </File> 73361 <File 73362 RelativePath="..\inspector\InjectedScript.h" 73363 > 73364 </File> 73365 <File 73366 RelativePath="..\inspector\InjectedScriptBase.cpp" 73367 > 73368 <FileConfiguration 73369 Name="Release|Win32" 73370 ExcludedFromBuild="true" 73371 > 73372 <Tool 73373 Name="VCCLCompilerTool" 73374 /> 73375 </FileConfiguration> 73376 <FileConfiguration 73377 Name="Production|Win32" 73378 ExcludedFromBuild="true" 73379 > 73380 <Tool 73381 Name="VCCLCompilerTool" 73382 /> 73383 </FileConfiguration> 73384 </File> 73385 <File 73386 RelativePath="..\inspector\InjectedScriptBase.h" 73387 > 73388 </File> 73389 <File 73390 RelativePath="..\inspector\InjectedScriptHost.cpp" 73391 > 73392 <FileConfiguration 73393 Name="Release|Win32" 73394 ExcludedFromBuild="true" 73395 > 73396 <Tool 73397 Name="VCCLCompilerTool" 73398 /> 73399 </FileConfiguration> 73400 <FileConfiguration 73401 Name="Production|Win32" 73402 ExcludedFromBuild="true" 73403 > 73404 <Tool 73405 Name="VCCLCompilerTool" 73406 /> 73407 </FileConfiguration> 73408 </File> 73409 <File 73410 RelativePath="..\inspector\InjectedScriptHost.h" 73411 > 73412 </File> 73413 <File 73414 RelativePath="..\inspector\InjectedScriptManager.cpp" 73415 > 73416 <FileConfiguration 73417 Name="Release|Win32" 73418 ExcludedFromBuild="true" 73419 > 73420 <Tool 73421 Name="VCCLCompilerTool" 73422 /> 73423 </FileConfiguration> 73424 <FileConfiguration 73425 Name="Production|Win32" 73426 ExcludedFromBuild="true" 73427 > 73428 <Tool 73429 Name="VCCLCompilerTool" 73430 /> 73431 </FileConfiguration> 73432 </File> 73433 <File 73434 RelativePath="..\inspector\InjectedScriptManager.h" 73438 RelativePath="..\inspector\InjectedScriptWebGLModule.cpp" 73439 > 73440 <FileConfiguration 73441 Name="Release|Win32" 73442 ExcludedFromBuild="true" 73443 > 73444 <Tool 73445 Name="VCCLCompilerTool" 73446 /> 73447 </FileConfiguration> 73448 <FileConfiguration 73449 Name="Production|Win32" 73450 ExcludedFromBuild="true" 73451 > 73452 <Tool 73453 Name="VCCLCompilerTool" 73454 /> 73455 </FileConfiguration> 73456 </File> 73457 <File 73458 RelativePath="..\inspector\InjectedScriptWebGLModule.h" 73435 73459 > 73436 73460 </File> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r120893 r120929 4466 4466 AA4C3A760B2B1679002334A2 /* StyleElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA4C3A740B2B1679002334A2 /* StyleElement.cpp */; }; 4467 4467 AA4C3A770B2B1679002334A2 /* StyleElement.h in Headers */ = {isa = PBXBuildFile; fileRef = AA4C3A750B2B1679002334A2 /* StyleElement.h */; }; 4468 AA73183E159255B900A93E6E /* InjectedScriptWebGLModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA73183C159255B900A93E6E /* InjectedScriptWebGLModule.cpp */; }; 4469 AA73183F159255B900A93E6E /* InjectedScriptWebGLModule.h in Headers */ = {isa = PBXBuildFile; fileRef = AA73183D159255B900A93E6E /* InjectedScriptWebGLModule.h */; }; 4468 4470 AAB6054E15874C58007B5031 /* InjectedScriptBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAB6054A15874C58007B5031 /* InjectedScriptBase.cpp */; }; 4469 4471 AAB6054F15874C58007B5031 /* InjectedScriptBase.h in Headers */ = {isa = PBXBuildFile; fileRef = AAB6054B15874C58007B5031 /* InjectedScriptBase.h */; }; … … 11479 11481 AA4C3A740B2B1679002334A2 /* StyleElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StyleElement.cpp; sourceTree = "<group>"; }; 11480 11482 AA4C3A750B2B1679002334A2 /* StyleElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StyleElement.h; sourceTree = "<group>"; }; 11483 AA73183C159255B900A93E6E /* InjectedScriptWebGLModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptWebGLModule.cpp; sourceTree = "<group>"; }; 11484 AA73183D159255B900A93E6E /* InjectedScriptWebGLModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptWebGLModule.h; sourceTree = "<group>"; }; 11481 11485 AA9030FE157E16A000276247 /* InjectedWebGLScriptSource.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = InjectedWebGLScriptSource.js; sourceTree = "<group>"; }; 11482 11486 AA912750157E35A500454E54 /* InjectedWebGLScriptSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedWebGLScriptSource.h; sourceTree = "<group>"; }; … … 14424 14428 AAB6054D15874C58007B5031 /* InjectedScriptModule.h */, 14425 14429 7A563F9512DF5C9100F4536D /* InjectedScriptSource.js */, 14430 AA73183C159255B900A93E6E /* InjectedScriptWebGLModule.cpp */, 14431 AA73183D159255B900A93E6E /* InjectedScriptWebGLModule.h */, 14426 14432 AA9030FE157E16A000276247 /* InjectedWebGLScriptSource.js */, 14427 14433 1C435CD414E8545B004E10EA /* Inspector-0.1.json */, … … 23340 23346 F316396C1329481A00A649CB /* InjectedScriptManager.h in Headers */, 23341 23347 AAB6055115874C58007B5031 /* InjectedScriptModule.h in Headers */, 23348 AA73183F159255B900A93E6E /* InjectedScriptWebGLModule.h in Headers */, 23342 23349 A8CFF5E50A155A05000A4234 /* InlineBox.h in Headers */, 23343 23350 A8CFF5E30A155A05000A4234 /* InlineFlowBox.h in Headers */, … … 26480 26487 F316396B1329481A00A649CB /* InjectedScriptManager.cpp in Sources */, 26481 26488 AAB6055015874C58007B5031 /* InjectedScriptModule.cpp in Sources */, 26489 AA73183E159255B900A93E6E /* InjectedScriptWebGLModule.cpp in Sources */, 26482 26490 A8CFF5E60A155A05000A4234 /* InlineBox.cpp in Sources */, 26483 26491 A8CFF5E40A155A05000A4234 /* InlineFlowBox.cpp in Sources */, -
trunk/Source/WebCore/inspector/InjectedScriptManager.cpp
r120347 r120929 38 38 #include "InjectedScriptHost.h" 39 39 #include "InjectedScriptSource.h" 40 #if ENABLE(WEBGL)41 #include "InjectedWebGLScriptSource.h"42 #endif43 40 #include "InspectorValues.h" 44 41 #include "ScriptObject.h" … … 191 188 } 192 189 193 #if ENABLE(WEBGL)194 ScriptObject InjectedScriptManager::wrapWebGLRenderingContextForInstrumentation(const ScriptObject&)195 {196 // FIXME(88973): Inject via this.injectScript()197 return ScriptObject();198 }199 200 String InjectedScriptManager::injectedWebGLScriptSource()201 {202 return String(reinterpret_cast<const char*>(InjectedWebGLScriptSource_js), sizeof(InjectedWebGLScriptSource_js));203 }204 #endif205 206 190 } // namespace WebCore 207 191 -
trunk/Source/WebCore/inspector/InjectedScriptManager.h
r120842 r120929 65 65 void releaseObjectGroup(const String& objectGroup); 66 66 67 #if ENABLE(WEBGL)68 ScriptObject wrapWebGLRenderingContextForInstrumentation(const ScriptObject&);69 #endif70 71 67 typedef bool (*InspectedStateAccessCheck)(ScriptState*); 72 68 InspectedStateAccessCheck inspectedStateAccessCheck() const { return m_inspectedStateAccessCheck; } … … 77 73 String injectedScriptSource(); 78 74 ScriptObject createInjectedScript(const String& source, ScriptState*, int id); 79 80 #if ENABLE(WEBGL)81 String injectedWebGLScriptSource();82 #endif83 75 84 76 static bool canAccessInspectedWindow(ScriptState*); -
trunk/Source/WebCore/inspector/InjectedScriptModule.cpp
r120842 r120929 47 47 } 48 48 49 void InjectedScriptModule::ensureInjected(InjectedScriptManager &injectedScriptManager, ScriptState* scriptState)49 void InjectedScriptModule::ensureInjected(InjectedScriptManager* injectedScriptManager, ScriptState* scriptState) 50 50 { 51 InjectedScript injectedScript = injectedScriptManager .injectedScriptFor(scriptState);51 InjectedScript injectedScript = injectedScriptManager->injectedScriptFor(scriptState); 52 52 ASSERT(!injectedScript.hasNoValue()); 53 53 if (injectedScript.hasNoValue()) … … 72 72 73 73 ScriptObject moduleObject(scriptState, resultValue); 74 initialize(moduleObject, injectedScriptManager .inspectedStateAccessCheck());74 initialize(moduleObject, injectedScriptManager->inspectedStateAccessCheck()); 75 75 } 76 76 -
trunk/Source/WebCore/inspector/InjectedScriptModule.h
r120842 r120929 51 51 // and call its ensureInjected() method immediately. 52 52 InjectedScriptModule(const String& name); 53 void ensureInjected(InjectedScriptManager &, ScriptState*);53 void ensureInjected(InjectedScriptManager*, ScriptState*); 54 54 }; 55 55 -
trunk/Source/WebCore/inspector/InjectedScriptWebGLModule.cpp
r120928 r120929 31 31 #include "config.h" 32 32 33 #if ENABLE(INSPECTOR) 33 #if ENABLE(INSPECTOR) && ENABLE(WEBGL) 34 34 35 #include "InjectedScript Module.h"35 #include "InjectedScriptWebGLModule.h" 36 36 37 37 #include "InjectedScript.h" 38 38 #include "InjectedScriptManager.h" 39 #include "InjectedWebGLScriptSource.h" 39 40 #include "ScriptFunctionCall.h" 40 41 #include "ScriptObject.h" … … 42 43 namespace WebCore { 43 44 44 InjectedScript Module::InjectedScriptModule(const String& name)45 : InjectedScript Base(name)45 InjectedScriptWebGLModule::InjectedScriptWebGLModule() 46 : InjectedScriptModule("InjectedScriptWebGLModule") 46 47 { 47 48 } 48 49 49 void InjectedScriptModule::ensureInjected(InjectedScriptManager&injectedScriptManager, ScriptState* scriptState)50 InjectedScriptWebGLModule InjectedScriptWebGLModule::moduleForState(InjectedScriptManager* injectedScriptManager, ScriptState* scriptState) 50 51 { 51 InjectedScript injectedScript = injectedScriptManager.injectedScriptFor(scriptState);52 ASSERT(!injectedScript.hasNoValue());53 if (injectedScript.hasNoValue())54 return; 52 InjectedScriptWebGLModule result; 53 result.ensureInjected(injectedScriptManager, scriptState); 54 return result; 55 } 55 56 56 // FIXME: Make the InjectedScript a module itself. 57 ScriptFunctionCall function(injectedScript.injectedScriptObject(), "module"); 58 function.appendArgument(name()); 57 String InjectedScriptWebGLModule::source() const 58 { 59 return String(reinterpret_cast<const char*>(InjectedWebGLScriptSource_js), sizeof(InjectedWebGLScriptSource_js)); 60 } 61 62 ScriptObject InjectedScriptWebGLModule::wrapWebGLContext(const ScriptObject& glContext) 63 { 64 ScriptFunctionCall function(injectedScriptObject(), "wrapWebGLContext"); 65 function.appendArgument(glContext); 59 66 bool hadException = false; 60 ScriptValue resultValue = injectedScript.callFunctionWithEvalEnabled(function, hadException); 67 ScriptValue resultValue = callFunctionWithEvalEnabled(function, hadException); 68 if (hadException || resultValue.hasNoValue() || !resultValue.isObject()) { 69 ASSERT_NOT_REACHED(); 70 return ScriptObject(); 71 } 72 return ScriptObject(glContext.scriptState(), resultValue); 73 } 74 75 void InjectedScriptWebGLModule::captureFrame(ErrorString* errorString, const String& contextId) 76 { 77 ScriptFunctionCall function(injectedScriptObject(), "captureFrame"); 78 function.appendArgument(contextId); 79 bool hadException = false; 80 callFunctionWithEvalEnabled(function, hadException); 61 81 ASSERT(!hadException); 62 if (hadException || resultValue.hasNoValue() || !resultValue.isObject()) { 63 ScriptFunctionCall function(injectedScript.injectedScriptObject(), "injectModule"); 64 function.appendArgument(name()); 65 function.appendArgument(source()); 66 resultValue = injectedScript.callFunctionWithEvalEnabled(function, hadException); 67 if (hadException || resultValue.hasNoValue() || !resultValue.isObject()) { 68 ASSERT_NOT_REACHED(); 69 return; 70 } 71 } 72 73 ScriptObject moduleObject(scriptState, resultValue); 74 initialize(moduleObject, injectedScriptManager.inspectedStateAccessCheck()); 82 if (hadException) 83 *errorString = "Internal error"; 75 84 } 76 85 77 86 } // namespace WebCore 78 87 79 #endif // ENABLE(INSPECTOR) 88 #endif // ENABLE(INSPECTOR) && ENABLE(WEBGL) -
trunk/Source/WebCore/inspector/InjectedScriptWebGLModule.h
r120928 r120929 29 29 */ 30 30 31 #ifndef InjectedScript Module_h32 #define InjectedScript Module_h31 #ifndef InjectedScriptWebGLModule_h 32 #define InjectedScriptWebGLModule_h 33 33 34 #include "InjectedScript Base.h"34 #include "InjectedScriptModule.h" 35 35 #include "PlatformString.h" 36 36 #include "ScriptState.h" … … 39 39 40 40 class InjectedScriptManager; 41 class ScriptObject; 41 42 42 #if ENABLE(INSPECTOR) 43 #if ENABLE(INSPECTOR) && ENABLE(WEBGL) 43 44 44 class InjectedScript Module : public InjectedScriptBase {45 class InjectedScriptWebGLModule : public InjectedScriptModule { 45 46 public: 46 virtual String source() const = 0;47 virtual String source() const; 47 48 48 protected: 49 // Do not expose constructor in the child classes as well. Instead provide 50 // a static factory method that would create a new instance of the class 51 // and call its ensureInjected() method immediately. 52 InjectedScriptModule(const String& name); 53 void ensureInjected(InjectedScriptManager&, ScriptState*); 49 static InjectedScriptWebGLModule moduleForState(InjectedScriptManager*, ScriptState*); 50 51 ScriptObject wrapWebGLContext(const ScriptObject& glContext); 52 void captureFrame(ErrorString*, const String& contextId); 53 54 private: 55 InjectedScriptWebGLModule(); 54 56 }; 55 57 -
trunk/Source/WebCore/inspector/InspectorWebGLAgent.cpp
r119589 r120929 36 36 37 37 #include "InjectedScriptManager.h" 38 #include "InjectedScriptWebGLModule.h" 38 39 #include "InspectorFrontend.h" 39 40 #include "InspectorState.h" … … 97 98 ScriptObject InspectorWebGLAgent::wrapWebGLRenderingContextForInstrumentation(const ScriptObject& glContext) 98 99 { 99 return m_injectedScriptManager->wrapWebGLRenderingContextForInstrumentation(glContext); 100 if (glContext.hasNoValue()) { 101 ASSERT_NOT_REACHED(); 102 return ScriptObject(); 103 } 104 InjectedScriptWebGLModule module = InjectedScriptWebGLModule::moduleForState(m_injectedScriptManager, glContext.scriptState()); 105 if (module.hasNoValue()) { 106 ASSERT_NOT_REACHED(); 107 return ScriptObject(); 108 } 109 return module.wrapWebGLContext(glContext); 100 110 } 101 111
Note: See TracChangeset
for help on using the changeset viewer.