Changeset 57505 in webkit
- Timestamp:
- Apr 13, 2010 12:22:14 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 deleted
- 23 edited
- 7 copied
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r57496 r57505 1 2010-04-12 Mikhail Naganov <mnaganov@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Replace hand-written JavaScriptProfile* bindings with idl-based, and 6 in Chromium port, bind them to the new V8's profiler API that is 7 aligned with JSC. 8 9 https://bugs.webkit.org/show_bug.cgi?id=37448 10 11 * DerivedSources.cpp: 12 * DerivedSources.make: 13 * GNUmakefile.am: 14 * WebCore.gypi: 15 * WebCore.pro: 16 * WebCore.vcproj/WebCore.vcproj: 17 * WebCore.xcodeproj/project.pbxproj: 18 * bindings/js/JSBindingsAllInOne.cpp: 19 * bindings/js/JSConsoleCustom.cpp: 20 * bindings/js/JSScriptProfileNodeCustom.cpp: Added. 21 (WebCore::JSScriptProfileNode::callUID): 22 (WebCore::JSScriptProfileNode::children): 23 * bindings/js/JavaScriptProfile.cpp: Removed. 24 * bindings/js/JavaScriptProfile.h: Removed. 25 * bindings/js/JavaScriptProfileNode.cpp: Removed. 26 * bindings/js/JavaScriptProfileNode.h: Removed. 27 * bindings/js/ScriptProfileNode.h: Added. 28 * bindings/scripts/CodeGeneratorJS.pm: 29 * bindings/scripts/CodeGeneratorV8.pm: 30 * bindings/v8/ScriptProfile.cpp: Added. 31 (WebCore::ScriptProfile::title): 32 (WebCore::ScriptProfile::uid): 33 (WebCore::ScriptProfile::head): 34 * bindings/v8/ScriptProfile.h: 35 (WebCore::ScriptProfile::create): 36 (WebCore::ScriptProfile::ScriptProfile): 37 * bindings/v8/ScriptProfileNode.cpp: Added. 38 (WebCore::ScriptProfileNode::functionName): 39 (WebCore::ScriptProfileNode::url): 40 (WebCore::ScriptProfileNode::lineNumber): 41 (WebCore::ScriptProfileNode::totalTime): 42 (WebCore::ScriptProfileNode::selfTime): 43 (WebCore::ScriptProfileNode::numberOfCalls): 44 (WebCore::ScriptProfileNode::children): 45 (WebCore::ScriptProfileNode::visible): 46 (WebCore::ScriptProfileNode::callUID): 47 * bindings/v8/ScriptProfileNode.h: Added. 48 (WebCore::ScriptProfileNode::create): 49 (WebCore::ScriptProfileNode::~ScriptProfileNode): 50 (WebCore::ScriptProfileNode::ScriptProfileNode): 51 * bindings/v8/ScriptProfiler.cpp: 52 (WebCore::ScriptProfiler::start): 53 (WebCore::ScriptProfiler::stop): 54 * bindings/v8/custom/V8ConsoleCustom.cpp: Added. 55 (WebCore::V8Console::profilesAccessorGetter): 56 * bindings/v8/custom/V8ScriptProfileCustom.cpp: Added. 57 (WebCore::toV8): 58 * bindings/v8/custom/V8ScriptProfileNodeCustom.cpp: Added. 59 (WebCore::V8ScriptProfileNode::childrenAccessorGetter): 60 (WebCore::V8ScriptProfileNode::callUIDAccessorGetter): 61 (WebCore::toV8): 62 * inspector/InspectorController.cpp: 63 (WebCore::InspectorController::getProfile): 64 * inspector/ScriptProfile.idl: Added. 65 * inspector/ScriptProfileNode.idl: Added. 66 * inspector/front-end/InspectorBackendStub.js: 67 (.WebInspector.InspectorBackendStub.prototype.getProfile): 68 * inspector/front-end/ProfilesPanel.js: 69 (WebInspector.ProfilesPanel.prototype.populateInterface): 70 (WebInspector.ProfilesPanel.prototype.profilerWasEnabled): 71 * page/Console.idl: 72 * platform/android/TemporaryLinkStubs.cpp: 73 1 74 2010-04-12 Antonio Gomes <tonikitoo@webkit.org> 2 75 -
trunk/WebCore/DerivedSources.cpp
r57204 r57505 198 198 #include "JSRGBColor.cpp" 199 199 #include "JSScreen.cpp" 200 #include "JSScriptProfile.cpp" 201 #include "JSScriptProfileNode.cpp" 200 202 #include "JSSharedWorker.cpp" 201 203 #include "JSSharedWorkerContext.cpp" -
trunk/WebCore/DerivedSources.make
r57204 r57505 244 244 SharedWorker \ 245 245 SharedWorkerContext \ 246 ScriptProfile \ 247 ScriptProfileNode \ 246 248 SQLError \ 247 249 SQLResultSet \ -
trunk/WebCore/GNUmakefile.am
r57494 r57505 271 271 WebCore/inspector/InspectorBackend.idl \ 272 272 WebCore/inspector/InspectorFrontendHost.idl \ 273 WebCore/inspector/ScriptProfile.idl \ 274 WebCore/inspector/ScriptProfileNode.idl \ 273 275 WebCore/notifications/Notification.idl \ 274 276 WebCore/notifications/NotificationCenter.idl \ … … 470 472 WebCore/bindings/js/JSPluginElementFunctions.h \ 471 473 WebCore/bindings/js/JSPopStateEventCustom.cpp \ 474 WebCore/bindings/js/JSScriptProfileNodeCustom.cpp \ 472 475 WebCore/bindings/js/JSStorageCustom.h \ 473 476 WebCore/bindings/js/JSStyleSheetCustom.cpp \ … … 488 491 WebCore/bindings/js/JSXSLTProcessorConstructor.h \ 489 492 WebCore/bindings/js/JSXSLTProcessorCustom.cpp \ 490 WebCore/bindings/js/JavaScriptProfile.cpp \491 WebCore/bindings/js/JavaScriptProfile.h \492 WebCore/bindings/js/JavaScriptProfileNode.cpp \493 WebCore/bindings/js/JavaScriptProfileNode.h \494 493 WebCore/bindings/js/ScheduledAction.cpp \ 495 494 WebCore/bindings/js/ScheduledAction.h \ … … 515 514 WebCore/bindings/js/ScriptObject.h \ 516 515 WebCore/bindings/js/ScriptProfile.h \ 516 WebCore/bindings/js/ScriptProfileNode.h \ 517 517 WebCore/bindings/js/ScriptProfiler.cpp \ 518 518 WebCore/bindings/js/ScriptProfiler.h \ -
trunk/WebCore/WebCore.gypi
r57494 r57505 192 192 'inspector/InspectorFrontendHost.idl', 193 193 'inspector/JavaScriptCallFrame.idl', 194 'inspector/ScriptProfile.idl', 195 'inspector/ScriptProfileNode.idl', 194 196 'loader/appcache/DOMApplicationCache.idl', 195 197 'notifications/Notification.idl', … … 599 601 'bindings/js/JSSharedWorkerConstructor.h', 600 602 'bindings/js/JSSharedWorkerCustom.cpp', 603 'bindings/js/JSScriptProfileNodeCustom.cpp', 601 604 'bindings/js/JSSQLResultSetRowListCustom.cpp', 602 605 'bindings/js/JSSQLTransactionCustom.cpp', … … 637 640 'bindings/js/JSXSLTProcessorConstructor.h', 638 641 'bindings/js/JSXSLTProcessorCustom.cpp', 639 'bindings/js/JavaScriptProfile.cpp',640 'bindings/js/JavaScriptProfile.h',641 'bindings/js/JavaScriptProfileNode.cpp',642 'bindings/js/JavaScriptProfileNode.h',643 642 'bindings/js/ScheduledAction.cpp', 644 643 'bindings/js/ScheduledAction.h', … … 695 694 'bindings/v8/custom/V8WebGLRenderingContextCustom.cpp', 696 695 'bindings/v8/custom/V8ClipboardCustom.cpp', 696 'bindings/v8/custom/V8ConsoleCustom.cpp', 697 697 'bindings/v8/custom/V8CoordinatesCustom.cpp', 698 698 'bindings/v8/custom/V8CSSRuleCustom.cpp', … … 771 771 'bindings/v8/custom/V8NotificationCenterCustom.cpp', 772 772 'bindings/v8/custom/V8PopStateEventCustom.cpp', 773 'bindings/v8/custom/V8ScriptProfileCustom.cpp', 774 'bindings/v8/custom/V8ScriptProfileNodeCustom.cpp', 773 775 'bindings/v8/custom/V8StorageCustom.cpp', 774 776 'bindings/v8/custom/V8SQLResultSetRowListCustom.cpp', … … 831 833 'bindings/v8/ScriptObject.cpp', 832 834 'bindings/v8/ScriptObject.h', 835 'bindings/v8/ScriptProfile.cpp', 833 836 'bindings/v8/ScriptProfile.h', 837 'bindings/v8/ScriptProfileNode.cpp', 838 'bindings/v8/ScriptProfileNode.h', 834 839 'bindings/v8/ScriptProfiler.cpp', 835 840 'bindings/v8/ScriptProfiler.h', -
trunk/WebCore/WebCore.pro
r57494 r57505 343 343 bindings/js/JSNodeListCustom.cpp \ 344 344 bindings/js/JSOptionConstructor.cpp \ 345 bindings/js/JSScriptProfileNodeCustom.cpp \ 345 346 bindings/js/JSStyleSheetCustom.cpp \ 346 347 bindings/js/JSStyleSheetListCustom.cpp \ … … 366 367 bindings/js/JSPopStateEventCustom.cpp \ 367 368 bindings/js/JSWorkerContextErrorHandler.cpp \ 368 bindings/js/JavaScriptProfile.h \369 bindings/js/JavaScriptProfileNode.h \370 bindings/js/JavaScriptProfile.cpp \371 bindings/js/JavaScriptProfileNode.cpp \372 369 bindings/js/ScriptArray.cpp \ 373 370 bindings/js/ScriptCachedFrameData.cpp \ … … 379 376 bindings/js/ScriptFunctionCall.cpp \ 380 377 bindings/js/ScriptObject.cpp \ 381 bindings/js/ScriptProfiler.cpp \382 378 bindings/js/ScriptState.cpp \ 383 379 bindings/js/ScriptValue.cpp \ … … 1091 1087 bindings/js/ScriptGCEvent.h \ 1092 1088 bindings/js/ScriptObject.h \ 1089 bindings/js/ScriptProfile.h \ 1090 bindings/js/ScriptProfileNode.h \ 1091 bindings/js/ScriptProfiler.h \ 1093 1092 bindings/js/ScriptSourceCode.h \ 1094 1093 bindings/js/ScriptSourceProvider.h \ … … 2729 2728 SOURCES += \ 2730 2729 bindings/js/JSJavaScriptCallFrameCustom.cpp \ 2730 bindings/js/ScriptProfiler.cpp \ 2731 2731 inspector/JavaScriptCallFrame.cpp \ 2732 2732 } -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r57494 r57505 34673 34673 </File> 34674 34674 <File 34675 RelativePath="..\bindings\js\JavaScriptProfile.cpp"34676 >34677 </File>34678 <File34679 RelativePath="..\bindings\js\JavaScriptProfile.h"34680 >34681 </File>34682 <File34683 RelativePath="..\bindings\js\JavaScriptProfileNode.cpp"34684 >34685 </File>34686 <File34687 RelativePath="..\bindings\js\JavaScriptProfileNode.h"34688 >34689 </File>34690 <File34691 34675 RelativePath="..\bindings\js\JSAbstractWorkerCustom.cpp" 34692 34676 > … … 39643 39627 RelativePath="..\bindings\js\JSSVGPODTypeWrapper.h" 39644 39628 > 39629 </File> 39630 <File 39631 RelativePath="..\bindings\js\JSScriptProfileNodeCustom.cpp" 39632 > 39633 <FileConfiguration 39634 Name="Debug|Win32" 39635 ExcludedFromBuild="true" 39636 > 39637 <Tool 39638 Name="VCCLCompilerTool" 39639 /> 39640 </FileConfiguration> 39641 <FileConfiguration 39642 Name="Release|Win32" 39643 ExcludedFromBuild="true" 39644 > 39645 <Tool 39646 Name="VCCLCompilerTool" 39647 /> 39648 </FileConfiguration> 39649 <FileConfiguration 39650 Name="Debug_Internal|Win32" 39651 ExcludedFromBuild="true" 39652 > 39653 <Tool 39654 Name="VCCLCompilerTool" 39655 /> 39656 </FileConfiguration> 39657 <FileConfiguration 39658 Name="Debug_Cairo|Win32" 39659 ExcludedFromBuild="true" 39660 > 39661 <Tool 39662 Name="VCCLCompilerTool" 39663 /> 39664 </FileConfiguration> 39665 <FileConfiguration 39666 Name="Release_Cairo|Win32" 39667 ExcludedFromBuild="true" 39668 > 39669 <Tool 39670 Name="VCCLCompilerTool" 39671 /> 39672 </FileConfiguration> 39673 <FileConfiguration 39674 Name="Debug_All|Win32" 39675 ExcludedFromBuild="true" 39676 > 39677 <Tool 39678 Name="VCCLCompilerTool" 39679 /> 39680 </FileConfiguration> 39645 39681 </File> 39646 39682 <File -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r57494 r57505 2493 2493 97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 97DD4D850FDF4D6E00ECF9A4 /* XSSAuditor.h */; }; 2494 2494 97EF7DFE107E55B700D7C49C /* ScriptControllerBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97EF7DFD107E55B700D7C49C /* ScriptControllerBase.cpp */; }; 2495 9F2A322B1125A0A2003C3056 /* JavaScriptProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F2A32271125A0A2003C3056 /* JavaScriptProfile.cpp */; };2496 9F2A322C1125A0A2003C3056 /* JavaScriptProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F2A32281125A0A2003C3056 /* JavaScriptProfile.h */; };2497 9F2A322D1125A0A2003C3056 /* JavaScriptProfileNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F2A32291125A0A2003C3056 /* JavaScriptProfileNode.cpp */; };2498 9F2A322E1125A0A2003C3056 /* JavaScriptProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F2A322A1125A0A2003C3056 /* JavaScriptProfileNode.h */; };2499 2495 9F6FC1961122E82A00E80196 /* ScriptDebugServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F6FC1941122E82A00E80196 /* ScriptDebugServer.cpp */; }; 2500 2496 9F6FC1971122E82A00E80196 /* ScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F6FC1951122E82A00E80196 /* ScriptDebugServer.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 2502 2498 9F72305011184B4100AD0126 /* ScriptProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F72304D11184B4100AD0126 /* ScriptProfiler.cpp */; }; 2503 2499 9F72305111184B4100AD0126 /* ScriptProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F72304E11184B4100AD0126 /* ScriptProfiler.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2500 9FA37EE41172FC8000C4CD55 /* ScriptProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FA37EE31172FC8000C4CD55 /* ScriptProfileNode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2501 9FA37EE71172FCF000C4CD55 /* JSScriptProfileNodeCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9FA37EE61172FCF000C4CD55 /* JSScriptProfileNodeCustom.cpp */; }; 2502 9FA37EFA1172FDA600C4CD55 /* JSScriptProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9FA37EF61172FD9300C4CD55 /* JSScriptProfile.cpp */; }; 2503 9FA37EFB1172FDA600C4CD55 /* JSScriptProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FA37EF71172FD9300C4CD55 /* JSScriptProfile.h */; }; 2504 9FA37EFC1172FDA600C4CD55 /* JSScriptProfileNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9FA37EF81172FD9300C4CD55 /* JSScriptProfileNode.cpp */; }; 2505 9FA37EFD1172FDA600C4CD55 /* JSScriptProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FA37EF91172FD9300C4CD55 /* JSScriptProfileNode.h */; }; 2504 2506 A136A00C1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A136A00A1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.cpp */; }; 2505 2507 A136A00D1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.h in Headers */ = {isa = PBXBuildFile; fileRef = A136A00B1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.h */; }; … … 7928 7930 97DD4D850FDF4D6E00ECF9A4 /* XSSAuditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSSAuditor.h; sourceTree = "<group>"; }; 7929 7931 97EF7DFD107E55B700D7C49C /* ScriptControllerBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptControllerBase.cpp; sourceTree = "<group>"; }; 7930 9F2A32271125A0A2003C3056 /* JavaScriptProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JavaScriptProfile.cpp; sourceTree = "<group>"; };7931 9F2A32281125A0A2003C3056 /* JavaScriptProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptProfile.h; sourceTree = "<group>"; };7932 9F2A32291125A0A2003C3056 /* JavaScriptProfileNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JavaScriptProfileNode.cpp; sourceTree = "<group>"; };7933 9F2A322A1125A0A2003C3056 /* JavaScriptProfileNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptProfileNode.h; sourceTree = "<group>"; };7934 7932 9F6FC1941122E82A00E80196 /* ScriptDebugServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptDebugServer.cpp; sourceTree = "<group>"; }; 7935 7933 9F6FC1951122E82A00E80196 /* ScriptDebugServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptDebugServer.h; sourceTree = "<group>"; }; … … 7937 7935 9F72304D11184B4100AD0126 /* ScriptProfiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptProfiler.cpp; sourceTree = "<group>"; }; 7938 7936 9F72304E11184B4100AD0126 /* ScriptProfiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptProfiler.h; sourceTree = "<group>"; }; 7937 9FA37EE31172FC8000C4CD55 /* ScriptProfileNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptProfileNode.h; sourceTree = "<group>"; }; 7938 9FA37EE61172FCF000C4CD55 /* JSScriptProfileNodeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScriptProfileNodeCustom.cpp; sourceTree = "<group>"; }; 7939 9FA37EEF1172FD4100C4CD55 /* ScriptProfile.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScriptProfile.idl; sourceTree = "<group>"; }; 7940 9FA37EF01172FD4100C4CD55 /* ScriptProfileNode.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScriptProfileNode.idl; sourceTree = "<group>"; }; 7941 9FA37EF61172FD9300C4CD55 /* JSScriptProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScriptProfile.cpp; sourceTree = "<group>"; }; 7942 9FA37EF71172FD9300C4CD55 /* JSScriptProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScriptProfile.h; sourceTree = "<group>"; }; 7943 9FA37EF81172FD9300C4CD55 /* JSScriptProfileNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScriptProfileNode.cpp; sourceTree = "<group>"; }; 7944 9FA37EF91172FD9300C4CD55 /* JSScriptProfileNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScriptProfileNode.h; sourceTree = "<group>"; }; 7939 7945 A136A00A1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLHttpRequestProgressEventThrottle.cpp; sourceTree = "<group>"; }; 7940 7946 A136A00B1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLHttpRequestProgressEventThrottle.h; sourceTree = "<group>"; }; … … 10785 10791 1C5FAECF0DCFD90100D58F78 /* JSJavaScriptCallFrame.cpp */, 10786 10792 1C5FAED00DCFD90100D58F78 /* JSJavaScriptCallFrame.h */, 10793 9FA37EF61172FD9300C4CD55 /* JSScriptProfile.cpp */, 10794 9FA37EF71172FD9300C4CD55 /* JSScriptProfile.h */, 10795 9FA37EF81172FD9300C4CD55 /* JSScriptProfileNode.cpp */, 10796 9FA37EF91172FD9300C4CD55 /* JSScriptProfileNode.h */, 10787 10797 ); 10788 10798 name = Inspector; … … 10831 10841 7AFD4A8A1131C2760035B883 /* ScriptBreakpoint.h */, 10832 10842 7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */, 10843 9FA37EEF1172FD4100C4CD55 /* ScriptProfile.idl */, 10844 9FA37EF01172FD4100C4CD55 /* ScriptProfileNode.idl */, 10833 10845 7553CFE7108F473F00EA281E /* TimelineRecordFactory.cpp */, 10834 10846 7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */, … … 14844 14856 1432E8480C51493F00B1500F /* GCController.cpp */, 14845 14857 1432E8460C51493800B1500F /* GCController.h */, 14846 9F2A32271125A0A2003C3056 /* JavaScriptProfile.cpp */,14847 9F2A32281125A0A2003C3056 /* JavaScriptProfile.h */,14848 9F2A32291125A0A2003C3056 /* JavaScriptProfileNode.cpp */,14849 9F2A322A1125A0A2003C3056 /* JavaScriptProfileNode.h */,14850 14858 B5D3601E112F8BA80048DEA8 /* JSDatabaseCallback.cpp */, 14851 14859 B5D3601C112F8BA00048DEA8 /* JSDatabaseCallback.h */, … … 14899 14907 41F066E20F64BCF600A07EAC /* ScriptObject.h */, 14900 14908 9F72304C11184B4100AD0126 /* ScriptProfile.h */, 14909 9FA37EE31172FC8000C4CD55 /* ScriptProfileNode.h */, 14901 14910 9F72304D11184B4100AD0126 /* ScriptProfiler.cpp */, 14902 14911 9F72304E11184B4100AD0126 /* ScriptProfiler.h */, … … 15044 15053 B297BC6F0B3C14CF0045A590 /* JSSVGPathSegListCustom.cpp */, 15045 15054 087D97BE10FB8D7700C00874 /* JSSVGPODListCustom.h */, 15055 9FA37EE61172FCF000C4CD55 /* JSScriptProfileNodeCustom.cpp */, 15046 15056 1A2C40AA0DEB55AA005AF19E /* JSTextCustom.cpp */, 15047 15057 516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */, … … 17574 17584 E16982681134680700894115 /* JavaRuntimeObject.h in Headers */, 17575 17585 1C81BA0A0E97348300266E07 /* JavaScriptCallFrame.h in Headers */, 17576 9F2A322C1125A0A2003C3056 /* JavaScriptProfile.h in Headers */,17577 9F2A322E1125A0A2003C3056 /* JavaScriptProfileNode.h in Headers */,17578 17586 59BC393F11054A1300FD85DB /* JavaStringJSC.h in Headers */, 17579 17587 1A569D040D7E2B82007C3983 /* jni_jsobject.h in Headers */, … … 18837 18845 895253D9116C4C6800CABF00 /* FileStreamClient.h in Headers */, 18838 18846 5DC87EF011716DF2001C0E6D /* EmptyProtocolDefinitions.h in Headers */, 18847 9FA37EE41172FC8000C4CD55 /* ScriptProfileNode.h in Headers */, 18848 9FA37EFB1172FDA600C4CD55 /* JSScriptProfile.h in Headers */, 18849 9FA37EFD1172FDA600C4CD55 /* JSScriptProfileNode.h in Headers */, 18839 18850 ); 18840 18851 runOnlyForDeploymentPostprocessing = 0; … … 19825 19836 E1698264113467F300894115 /* JavaRuntimeObject.cpp in Sources */, 19826 19837 1C81BA090E97348300266E07 /* JavaScriptCallFrame.cpp in Sources */, 19827 9F2A322B1125A0A2003C3056 /* JavaScriptProfile.cpp in Sources */,19828 9F2A322D1125A0A2003C3056 /* JavaScriptProfileNode.cpp in Sources */,19829 19838 1A569D030D7E2B82007C3983 /* jni_jsobject.mm in Sources */, 19830 19839 1A569D050D7E2B82007C3983 /* jni_objc.mm in Sources */, … … 21070 21079 A409C984116D0DDD007197BD /* AccessibilityProgressIndicator.cpp in Sources */, 21071 21080 895253D7116C4C6800CABF00 /* FileStream.cpp in Sources */, 21081 9FA37EE71172FCF000C4CD55 /* JSScriptProfileNodeCustom.cpp in Sources */, 21082 9FA37EFA1172FDA600C4CD55 /* JSScriptProfile.cpp in Sources */, 21083 9FA37EFC1172FDA600C4CD55 /* JSScriptProfileNode.cpp in Sources */, 21072 21084 ); 21073 21085 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/bindings/js/JSBindingsAllInOne.cpp
r57134 r57505 114 114 #include "JSSVGPathSegCustom.cpp" 115 115 #include "JSSVGPathSegListCustom.cpp" 116 #include "JSScriptProfileNodeCustom.cpp" 116 117 #include "JSSharedWorkerConstructor.cpp" 117 118 #include "JSSharedWorkerCustom.cpp" -
trunk/WebCore/bindings/js/JSConsoleCustom.cpp
r54277 r57505 29 29 30 30 #include "Console.h" 31 #include "J avaScriptProfile.h"31 #include "JSScriptProfile.h" 32 32 #include "ScriptCallStack.h" 33 #include "ScriptProfile.h" 33 34 #include <runtime/JSArray.h> 34 35 … … 39 40 #if ENABLE(JAVASCRIPT_DEBUGGER) 40 41 41 typedef Vector<RefPtr< JSC::Profile> > ProfilesArray;42 typedef Vector<RefPtr<ScriptProfile> > ProfilesArray; 42 43 43 44 JSValue JSConsole::profiles(ExecState* exec) const -
trunk/WebCore/bindings/js/JSScriptProfileNodeCustom.cpp
r57503 r57505 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 11 12 * documentation and/or other materials provided with the distribution. 12 13 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 14 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 17 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, … … 26 27 #include "config.h" 27 28 28 #include "JS Console.h"29 #include "JSScriptProfileNode.h" 29 30 30 #include "Console.h" 31 #include "JavaScriptProfile.h" 32 #include "ScriptCallStack.h" 31 #if ENABLE(JAVASCRIPT_DEBUGGER) 32 #include <profiler/ProfileNode.h> 33 #endif 34 33 35 #include <runtime/JSArray.h> 34 36 … … 39 41 #if ENABLE(JAVASCRIPT_DEBUGGER) 40 42 41 typedef Vector<RefPtr<JSC::Profile> > ProfilesArray; 43 JSValue JSScriptProfileNode::callUID(ExecState* exec) const 44 { 45 JSValue result = jsNumber(exec, impl()->callIdentifier().hash()); 46 return result; 47 } 42 48 43 JSValue JSConsole::profiles(ExecState* exec) const 49 typedef Vector<RefPtr<ProfileNode> > ProfileNodesList; 50 51 JSValue JSScriptProfileNode::children(ExecState* exec) const 44 52 { 45 const Profile sArray& profiles = impl()->profiles();53 const ProfileNodesList& children = impl()->children(); 46 54 MarkedArgumentBuffer list; 47 55 48 Profile sArray::const_iterator end = profiles.end();49 for (Profile sArray::const_iterator iter = profiles.begin(); iter != end; ++iter)56 ProfileNodesList::const_iterator end = children.end(); 57 for (ProfileNodesList::const_iterator iter = children.begin(); iter != end; ++iter) 50 58 list.append(toJS(exec, iter->get())); 51 59 -
trunk/WebCore/bindings/js/ScriptProfileNode.h
r57503 r57505 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 11 12 * documentation and/or other materials provided with the distribution. 12 13 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 14 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 17 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, … … 24 25 */ 25 26 26 #ifndef JavaScriptProfile_h27 #define JavaScriptProfile_h27 #ifndef ScriptProfileNode_h 28 #define ScriptProfileNode_h 28 29 29 30 #if ENABLE(JAVASCRIPT_DEBUGGER) 30 31 #include <runtime/JSValue.h> 32 33 namespace JSC { 34 class ExecState; 35 class Profile; 36 } 31 #include <profiler/ProfileNode.h> 37 32 38 33 namespace WebCore { 39 34 40 JSC::JSValue toJS(JSC::ExecState*, JSC::Profile*);35 typedef JSC::ProfileNode ScriptProfileNode; 41 36 42 37 } // namespace WebCore … … 44 39 #endif // ENABLE(JAVASCRIPT_DEBUGGER) 45 40 46 #endif 41 #endif // ScriptProfileNode_h -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r57163 r57505 215 215 } 216 216 217 sub IsScriptProfileType 218 { 219 my $type = shift; 220 return 1 if ($type eq "ScriptProfile" or $type eq "ScriptProfileNode"); 221 return 0; 222 } 223 224 sub AddTypedefForScriptProfileType 225 { 226 my $type = shift; 227 (my $jscType = $type) =~ s/Script//; 228 229 push(@headerContent, "typedef JSC::$jscType $type;\n\n"); 230 } 231 217 232 sub AddClassForwardIfNeeded 218 233 { … … 220 235 221 236 # SVGAnimatedLength/Number/etc. are typedefs to SVGAnimatedTemplate, so don't use class forwards for them! 222 push(@headerContent, "class $implClassName;\n\n") unless $codeGenerator->IsSVGAnimatedType($implClassName); 237 unless ($codeGenerator->IsSVGAnimatedType($implClassName) or IsScriptProfileType($implClassName)) { 238 push(@headerContent, "class $implClassName;\n\n"); 239 # ScriptProfile and ScriptProfileNode are typedefs to JSC::Profile and JSC::ProfileNode. 240 } elsif (IsScriptProfileType($implClassName)) { 241 AddTypedefForScriptProfileType($implClassName); 242 } 223 243 } 224 244 -
trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm
r57207 r57505 2124 2124 return 1 if $interfaceName eq "SVGDocument"; 2125 2125 return 1 if $interfaceName eq "SVGElement"; 2126 return 1 if $interfaceName eq "ScriptProfile"; 2127 return 1 if $interfaceName eq "ScriptProfileNode"; 2126 2128 return 1 if $interfaceName eq "WorkerContext"; 2127 2129 # We don't generate a custom converter (but JSC does) for the following: -
trunk/WebCore/bindings/v8/ScriptProfile.cpp
r57503 r57505 31 31 #include "config.h" 32 32 33 #include "ScriptProfiler.h" 33 #include "ScriptProfile.h" 34 35 #include "V8Binding.h" 36 37 #include <v8-profiler.h> 34 38 35 39 namespace WebCore { 36 40 37 void ScriptProfiler::start(ScriptState* state, const String& title) 41 String ScriptProfile::title() const 38 42 { 39 v8::HandleScope scope; 40 v8::Context::Scope contextScope(v8::Context::GetCurrent()); 41 v8::V8::ResumeProfiler(); 43 return toWebCoreString(m_profile->GetTitle()); 42 44 } 43 45 44 PassRefPtr<ScriptProfile> ScriptProfiler::stop(ScriptState* state, const String& title) 46 unsigned int ScriptProfile::uid() const 45 47 { 46 v8::V8::PauseProfiler(); 47 return 0; 48 return m_profile->GetUid(); 49 } 50 51 PassRefPtr<ScriptProfileNode> ScriptProfile::head() const 52 { 53 return ScriptProfileNode::create(m_profile->GetTopDownRoot()); 48 54 } 49 55 -
trunk/WebCore/bindings/v8/ScriptProfile.h
r54277 r57505 33 33 34 34 #include "PlatformString.h" 35 #include "ScriptProfileNode.h" 36 37 namespace v8 { 38 class CpuProfile; 39 } 35 40 36 41 namespace WebCore { … … 38 43 class ScriptProfile : public RefCounted<ScriptProfile> { 39 44 public: 40 static PassRefPtr<ScriptProfile> create(const String& title, unsigned uid)45 static PassRefPtr<ScriptProfile> create(const v8::CpuProfile* profile) 41 46 { 42 return adoptRef(new ScriptProfile(title, uid));47 return adoptRef(new ScriptProfile(profile)); 43 48 } 44 49 virtual ~ScriptProfile() {} 45 50 46 String title() const { return m_title; } 47 unsigned int uid() const { return m_uid; } 51 String title() const; 52 unsigned int uid() const; 53 PassRefPtr<ScriptProfileNode> head() const; 48 54 49 55 protected: 50 ScriptProfile(const String& title, unsigned uid) 51 : m_title(title) 52 , m_uid(uid) 56 ScriptProfile(const v8::CpuProfile* profile) 57 : m_profile(profile) 53 58 {} 54 59 55 60 private: 56 String m_title; 57 unsigned int m_uid; 61 const v8::CpuProfile* m_profile; 58 62 }; 59 63 -
trunk/WebCore/bindings/v8/ScriptProfileNode.cpp
r57503 r57505 31 31 #include "config.h" 32 32 33 #include "ScriptProfiler.h" 33 #include "ScriptProfile.h" 34 35 #include "V8Binding.h" 36 37 #include <v8-profiler.h> 34 38 35 39 namespace WebCore { 36 40 37 void ScriptProfiler::start(ScriptState* state, const String& title) 41 String ScriptProfileNode::functionName() const 38 42 { 39 v8::HandleScope scope; 40 v8::Context::Scope contextScope(v8::Context::GetCurrent()); 41 v8::V8::ResumeProfiler(); 43 return toWebCoreString(m_profileNode->GetFunctionName()); 42 44 } 43 45 44 PassRefPtr<ScriptProfile> ScriptProfiler::stop(ScriptState* state, const String& title) 46 String ScriptProfileNode::url() const 45 47 { 46 v8::V8::PauseProfiler(); 48 return toWebCoreString(m_profileNode->GetScriptResourceName()); 49 } 50 51 unsigned long ScriptProfileNode::lineNumber() const 52 { 53 return m_profileNode->GetLineNumber(); 54 } 55 56 double ScriptProfileNode::totalTime() const 57 { 58 // FIXME: use GetTotalMilliseconds once it is implemented in V8. 59 return m_profileNode->GetTotalSamplesCount(); 60 } 61 62 double ScriptProfileNode::selfTime() const 63 { 64 // FIXME: use GetSelfMilliseconds once it is implemented in V8. 65 return m_profileNode->GetSelfSamplesCount(); 66 } 67 68 unsigned long ScriptProfileNode::numberOfCalls() const 69 { 47 70 return 0; 48 71 } 49 72 73 ProfileNodesList ScriptProfileNode::children() const 74 { 75 const int childrenCount = m_profileNode->GetChildrenCount(); 76 ProfileNodesList result(childrenCount); 77 for (int i = 0; i < childrenCount; ++i) 78 result[i] = ScriptProfileNode::create(m_profileNode->GetChild(i)); 79 return result; 80 } 81 82 bool ScriptProfileNode::visible() const 83 { 84 return true; 85 } 86 87 unsigned long ScriptProfileNode::callUID() const 88 { 89 return m_profileNode->GetCallUid(); 90 } 91 50 92 } // namespace WebCore -
trunk/WebCore/bindings/v8/ScriptProfileNode.h
r57503 r57505 29 29 */ 30 30 31 #ifndef ScriptProfile _h32 #define ScriptProfile _h31 #ifndef ScriptProfileNode_h 32 #define ScriptProfileNode_h 33 33 34 34 #include "PlatformString.h" 35 35 36 namespace v8 { 37 class CpuProfileNode; 38 } 39 36 40 namespace WebCore { 37 41 38 class ScriptProfile : public RefCounted<ScriptProfile> { 42 class ScriptProfileNode; 43 44 typedef Vector<RefPtr<ScriptProfileNode> > ProfileNodesList; 45 46 class ScriptProfileNode : public RefCounted<ScriptProfileNode> { 39 47 public: 40 static PassRefPtr<ScriptProfile > create(const String& title, unsigned uid)48 static PassRefPtr<ScriptProfileNode> create(const v8::CpuProfileNode* profileNode) 41 49 { 42 return adoptRef(new ScriptProfile(title, uid));50 return adoptRef(new ScriptProfileNode(profileNode)); 43 51 } 44 virtual ~ScriptProfile () {}52 virtual ~ScriptProfileNode() {} 45 53 46 String title() const { return m_title; } 47 unsigned int uid() const { return m_uid; } 54 String functionName() const; 55 String url() const; 56 unsigned long lineNumber() const; 57 double totalTime() const; 58 double selfTime() const; 59 unsigned long numberOfCalls() const; 60 ProfileNodesList children() const; 61 bool visible() const; 62 unsigned long callUID() const; 48 63 49 64 protected: 50 ScriptProfile(const String& title, unsigned uid) 51 : m_title(title) 52 , m_uid(uid) 65 ScriptProfileNode(const v8::CpuProfileNode* profileNode) 66 : m_profileNode(profileNode) 53 67 {} 54 68 55 69 private: 56 String m_title; 57 unsigned int m_uid; 70 const v8::CpuProfileNode* m_profileNode; 58 71 }; 59 72 60 73 } // namespace WebCore 61 74 62 #endif // ScriptProfile _h75 #endif // ScriptProfileNode_h -
trunk/WebCore/bindings/v8/ScriptProfiler.cpp
r54277 r57505 32 32 33 33 #include "ScriptProfiler.h" 34 #include "ScriptString.h" 35 36 #include <v8-profiler.h> 34 37 35 38 namespace WebCore { … … 37 40 void ScriptProfiler::start(ScriptState* state, const String& title) 38 41 { 39 v8::HandleScope scope; 40 v8::Context::Scope contextScope(v8::Context::GetCurrent()); 41 v8::V8::ResumeProfiler(); 42 v8::HandleScope hs; 43 v8::CpuProfiler::StartProfiling(v8String(title)); 42 44 } 43 45 44 46 PassRefPtr<ScriptProfile> ScriptProfiler::stop(ScriptState* state, const String& title) 45 47 { 46 v8::V8::PauseProfiler(); 47 return 0; 48 v8::HandleScope hs; 49 const v8::CpuProfile* profile = v8::CpuProfiler::StopProfiling(v8String(title)); 50 return profile ? ScriptProfile::create(profile) : 0; 48 51 } 49 52 -
trunk/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp
r57503 r57505 1 1 /* 2 * Copyright ( c) 2010,Google Inc. All rights reserved.2 * Copyright (C) 2010 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 31 31 #include "config.h" 32 32 33 #include "ScriptProfiler.h" 33 #include "V8Console.h" 34 35 #include "Console.h" 36 #include "ScriptProfile.h" 37 #include "V8Binding.h" 38 #include "V8Proxy.h" 39 #include "V8ScriptProfile.h" 34 40 35 41 namespace WebCore { 36 42 37 void ScriptProfiler::start(ScriptState* state, const String& title) 43 typedef Vector<RefPtr<ScriptProfile> > ProfilesArray; 44 45 v8::Handle<v8::Value> V8Console::profilesAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) 38 46 { 39 v8::HandleScope scope;40 v8::Context::Scope contextScope(v8::Context::GetCurrent());41 v8::V8::ResumeProfiler();42 } 43 44 PassRefPtr<ScriptProfile> ScriptProfiler::stop(ScriptState* state, const String& title) 45 { 46 v8::V8::PauseProfiler();47 return 0;47 INC_STATS("DOM.Console.profilesAccessorGetter"); 48 Console* imp = V8Console::toNative(info.Holder()); 49 const ProfilesArray& profiles = imp->profiles(); 50 v8::Handle<v8::Array> result = v8::Array::New(profiles.size()); 51 int index = 0; 52 ProfilesArray::const_iterator end = profiles.end(); 53 for (ProfilesArray::const_iterator iter = profiles.begin(); iter != end; ++iter) 54 result->Set(v8::Integer::New(index++), toV8(iter->get())); 55 return result; 48 56 } 49 57 -
trunk/WebCore/bindings/v8/custom/V8ScriptProfileCustom.cpp
r57503 r57505 1 1 /* 2 * Copyright ( c) 2010,Google Inc. All rights reserved.2 * Copyright (C) 2010 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 31 31 #include "config.h" 32 #include "V8ScriptProfile.h" 32 33 33 #include "ScriptProfiler.h" 34 #include "ScriptProfile.h" 35 #include "V8Binding.h" 36 #include "V8Proxy.h" 37 38 #include <v8-profiler.h> 34 39 35 40 namespace WebCore { 36 41 37 v oid ScriptProfiler::start(ScriptState* state, const String& title)42 v8::Handle<v8::Value> toV8(ScriptProfile* impl) 38 43 { 39 v8::HandleScope scope; 40 v8::Context::Scope contextScope(v8::Context::GetCurrent()); 41 v8::V8::ResumeProfiler(); 42 } 43 44 PassRefPtr<ScriptProfile> ScriptProfiler::stop(ScriptState* state, const String& title) 45 { 46 v8::V8::PauseProfiler(); 47 return 0; 44 if (!impl) 45 return v8::Null(); 46 v8::Local<v8::Function> function = V8ScriptProfile::GetTemplate()->GetFunction(); 47 if (function.IsEmpty()) { 48 // Return if allocation failed. 49 return v8::Local<v8::Object>(); 50 } 51 v8::Local<v8::Object> instance = SafeAllocation::newInstance(function); 52 if (instance.IsEmpty()) { 53 // Avoid setting the wrapper if allocation failed. 54 return v8::Local<v8::Object>(); 55 } 56 impl->ref(); 57 V8DOMWrapper::setDOMWrapper(instance, &V8ScriptProfile::info, impl); 58 return instance; 48 59 } 49 60 -
trunk/WebCore/inspector/InspectorController.cpp
r57337 r57505 100 100 #if ENABLE(JAVASCRIPT_DEBUGGER) 101 101 #include "ScriptDebugServer.h" 102 #endif 103 104 #if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC) 105 #include "JavaScriptProfile.h" 106 102 #if USE(JSC) 107 103 #include <runtime/JSLock.h> 108 104 #include <runtime/UString.h> 105 #include "JSScriptProfile.h" 106 #else 107 #include "V8ScriptProfile.h" 108 #endif 109 109 #endif 110 110 … … 1375 1375 return; 1376 1376 ProfilesMap::iterator it = m_profiles.find(uid); 1377 if (it != m_profiles.end()) 1377 1378 #if USE(JSC) 1378 if (it != m_profiles.end())1379 1379 m_frontend->didGetProfile(callId, toJS(m_frontend->scriptState(), it->second.get())); 1380 #else 1381 m_frontend->didGetProfile(callId, toV8(it->second.get())); 1380 1382 #endif 1381 1383 } -
trunk/WebCore/inspector/ScriptProfile.idl
r57503 r57505 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 11 12 * documentation and/or other materials provided with the distribution. 12 13 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 14 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 17 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, … … 24 25 */ 25 26 26 #ifndef JavaScriptProfileNode_h 27 #define JavaScriptProfileNode_h 27 module core { 28 28 29 #if ENABLE(JAVASCRIPT_DEBUGGER) 29 interface [Conditional=JAVASCRIPT_DEBUGGER, OmitConstructor] ScriptProfile { 30 readonly attribute DOMString title; 31 readonly attribute unsigned long uid; 32 readonly attribute ScriptProfileNode head; 33 }; 30 34 31 #include <JavaScriptCore/JSBase.h>32 #include <runtime/JSValue.h>33 34 namespace JSC {35 class ExecState;36 class ProfileNode;37 35 } 38 39 namespace WebCore {40 41 JSClassRef ProfileNodeClass();42 JSC::JSValue toJS(JSC::ExecState*, JSC::ProfileNode*);43 44 } // namespace WebCore45 46 #endif // ENABLE(JAVASCRIPT_DEBUGGER)47 48 #endif -
trunk/WebCore/inspector/ScriptProfileNode.idl
r57503 r57505 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 11 12 * documentation and/or other materials provided with the distribution. 12 13 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 14 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 17 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, … … 24 25 */ 25 26 26 #ifndef JavaScriptProfileNode_h 27 #define JavaScriptProfileNode_h 27 module core { 28 28 29 #if ENABLE(JAVASCRIPT_DEBUGGER) 29 interface [Conditional=JAVASCRIPT_DEBUGGER, OmitConstructor] ScriptProfileNode { 30 readonly attribute DOMString functionName; 31 readonly attribute DOMString url; 32 readonly attribute unsigned long lineNumber; 33 readonly attribute double totalTime; 34 readonly attribute double selfTime; 35 readonly attribute unsigned long numberOfCalls; 36 readonly attribute [CustomGetter] Array children; 37 readonly attribute boolean visible; 38 readonly attribute [CustomGetter] unsigned long callUID; 39 }; 30 40 31 #include <JavaScriptCore/JSBase.h>32 #include <runtime/JSValue.h>33 34 namespace JSC {35 class ExecState;36 class ProfileNode;37 41 } 38 39 namespace WebCore {40 41 JSClassRef ProfileNodeClass();42 JSC::JSValue toJS(JSC::ExecState*, JSC::ProfileNode*);43 44 } // namespace WebCore45 46 #endif // ENABLE(JAVASCRIPT_DEBUGGER)47 48 #endif -
trunk/WebCore/inspector/front-end/InspectorBackendStub.js
r55537 r57505 215 215 getProfile: function(callId, uid) 216 216 { 217 if (WebInspector.__fullProfiles && (uid in WebInspector.__fullProfiles))218 {219 WebInspector.didGetProfile(callId, WebInspector.__fullProfiles[uid]);220 }221 217 }, 222 218 -
trunk/WebCore/inspector/front-end/ProfilesPanel.js
r56711 r57505 165 165 populateInterface: function() 166 166 { 167 this.reset(); 167 168 if (this.visible) 168 169 this._populateProfiles(); … … 177 178 178 179 this._profilerEnabled = true; 179 this.reset();180 180 this.populateInterface(); 181 181 }, -
trunk/WebCore/page/Console.idl
r54576 r57505 31 31 interface [OmitConstructor] Console { 32 32 33 // Not enabled in V8 because it requires request-reply style. 34 #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER && !(defined(V8_BINDING) && V8_BINDING) 33 #if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER 35 34 readonly attribute [CustomGetter] Array profiles; 36 35 #endif -
trunk/WebCore/platform/android/TemporaryLinkStubs.cpp
r56825 r57505 85 85 #include "JNIUtilityPrivate.h" 86 86 #include "JavaScriptCallFrame.h" 87 #include "JavaScriptProfile.h"88 87 #include "ScriptDebugServer.h" 89 88 #endif -
trunk/WebKit/chromium/ChangeLog
r57469 r57505 1 2010-04-12 Mikhail Naganov <mnaganov@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Replace hand-written JavaScriptProfile* bindings with idl-based, and 6 in Chromium port, bind them to the new V8's profiler API that is 7 aligned with JSC. 8 9 https://bugs.webkit.org/show_bug.cgi?id=37448 10 11 * src/js/InspectorControllerImpl.js: 12 (devtools.InspectorBackendImpl): 13 * src/js/ProfilerAgent.js: 14 (devtools.ProfilerAgent): 15 (devtools.ProfilerAgent.prototype.initializeProfiling): 16 (devtools.ProfilerAgent.prototype._didGetActiveProfilerModules): 17 (devtools.ProfilerAgent.prototype._didGetLogLines): 18 * src/js/Tests.js: 19 1 20 2010-04-11 Sheriff Bot <webkit.review.bot@gmail.com> 2 21 -
trunk/WebKit/chromium/src/js/InspectorControllerImpl.js
r56448 r57505 55 55 this.installInspectorControllerDelegate_("getDOMStorageEntries"); 56 56 this.installInspectorControllerDelegate_("getEventListenersForNode"); 57 this.installInspectorControllerDelegate_("getProfile"); 58 this.installInspectorControllerDelegate_("getProfileHeaders"); 57 59 this.installInspectorControllerDelegate_("getResourceContent"); 58 60 this.installInspectorControllerDelegate_("highlightDOMNode"); … … 69 71 this.installInspectorControllerDelegate_("setInjectedScriptSource"); 70 72 this.installInspectorControllerDelegate_("setTextNodeValue"); 73 this.installInspectorControllerDelegate_("startProfiling"); 71 74 this.installInspectorControllerDelegate_("startTimelineProfiler"); 75 this.installInspectorControllerDelegate_("stopProfiling"); 72 76 this.installInspectorControllerDelegate_("stopTimelineProfiler"); 73 77 this.installInspectorControllerDelegate_("storeLastActivePanel"); … … 194 198 * @override 195 199 */ 196 devtools.InspectorBackendImpl.prototype.startProfiling = function()197 {198 devtools.tools.getProfilerAgent().startProfiling(devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_CPU);199 };200 201 202 /**203 * @override204 */205 devtools.InspectorBackendImpl.prototype.stopProfiling = function()206 {207 devtools.tools.getProfilerAgent().stopProfiling( devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_CPU);208 };209 210 211 /**212 * @override213 */214 devtools.InspectorBackendImpl.prototype.getProfileHeaders = function(callId)215 {216 WebInspector.didGetProfileHeaders(callId, []);217 };218 219 220 /**221 * Emulate WebKit InspectorController behavior. It stores profiles on renderer side,222 * and is able to retrieve them by uid using "getProfile".223 */224 devtools.InspectorBackendImpl.prototype.addFullProfile = function(profile)225 {226 WebInspector.__fullProfiles = WebInspector.__fullProfiles || {};227 WebInspector.__fullProfiles[profile.uid] = profile;228 };229 230 231 /**232 * @override233 */234 devtools.InspectorBackendImpl.prototype.getProfile = function(callId, uid)235 {236 if (WebInspector.__fullProfiles && (uid in WebInspector.__fullProfiles))237 WebInspector.didGetProfile(callId, WebInspector.__fullProfiles[uid]);238 };239 240 241 /**242 * @override243 */244 200 devtools.InspectorBackendImpl.prototype.takeHeapSnapshot = function() 245 201 { -
trunk/WebKit/chromium/src/js/ProfilerAgent.js
r54667 r57505 42 42 43 43 /** 44 * Active profiler modules flags.45 * @type {number}46 */47 this._activeProfilerModules = devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_NONE;48 49 /**50 * Interval for polling profiler state.51 * @type {number}52 */53 this._getActiveProfilerModulesInterval = null;54 55 /**56 44 * Profiler log position. 57 45 * @type {number} … … 64 52 */ 65 53 this._lastRequestedLogPosition = -1; 66 67 /**68 * Whether log contents retrieval must be forced next time.69 * @type {boolean}70 */71 this._forceGetLogLines = false;72 54 73 55 /** … … 93 75 94 76 /** 95 * Sets up callbacks that deal with profiles processing.96 */97 devtools.ProfilerAgent.prototype.setupProfilerProcessorCallbacks = function()98 {99 // A temporary icon indicating that the profile is being processed.100 var processingIcon = new WebInspector.SidebarTreeElement(101 "profile-sidebar-tree-item",102 WebInspector.UIString("Processing..."),103 '', null, false);104 var profilesSidebar = WebInspector.panels.profiles.getProfileType(WebInspector.CPUProfileType.TypeId).treeElement;105 106 this._profilerProcessor.setCallbacks(107 function onProfileProcessingStarted() {108 // Set visually empty string. Subtitle hiding is done via styles109 // manipulation which doesn't play well with dynamic append / removal.110 processingIcon.subtitle = " ";111 profilesSidebar.appendChild(processingIcon);112 },113 function onProfileProcessingStatus(ticksCount) {114 processingIcon.subtitle = WebInspector.UIString("%d ticks processed", ticksCount);115 },116 function onProfileProcessingFinished(profile) {117 profilesSidebar.removeChild(processingIcon);118 profile.typeId = WebInspector.CPUProfileType.TypeId;119 InspectorBackend.addFullProfile(profile);120 WebInspector.addProfileHeader(profile);121 // If no profile is currently shown, show the new one.122 var profilesPanel = WebInspector.panels.profiles;123 if (!profilesPanel.visibleView) {124 profilesPanel.showProfile(profile);125 }126 }127 );128 };129 130 131 /**132 77 * Initializes profiling state. 133 78 */ 134 79 devtools.ProfilerAgent.prototype.initializeProfiling = function() 135 80 { 136 this.setupProfilerProcessorCallbacks(); 137 this._forceGetLogLines = true; 138 this._getActiveProfilerModulesInterval = setInterval(function() { RemoteProfilerAgent.getActiveProfilerModules(); }, 1000); 81 this._getNextLogLines(false); 139 82 }; 140 83 … … 194 137 devtools.ProfilerAgent.prototype._didGetActiveProfilerModules = function(modules) 195 138 { 196 var profModules = devtools.ProfilerAgent.ProfilerModules;197 var profModuleNone = profModules.PROFILER_MODULE_NONE;198 if (this._forceGetLogLines || (modules !== profModuleNone && this._activeProfilerModules === profModuleNone)) {199 this._forceGetLogLines = false;200 // Start to query log data.201 this._getNextLogLines(true);202 }203 this._activeProfilerModules = modules;204 // Update buttons.205 WebInspector.setRecordingProfile(modules & profModules.PROFILER_MODULE_CPU);206 139 }; 207 140 … … 215 148 { 216 149 this._logPosition = pos; 217 if (log.length > 0) 150 if (log.length > 0) { 218 151 this._profilerProcessor.processLogChunk(log); 219 else { 152 this._getNextLogLines(); 153 } else { 220 154 // Allow re-reading from the last position. 221 155 this._lastRequestedLogPosition = this._logPosition - 1; 222 if (this._activeProfilerModules === devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_NONE)223 // No new data and profiling is stopped---suspend log reading.224 return;225 156 } 226 this._getNextLogLines();227 157 }; -
trunk/WebKit/chromium/src/js/Tests.js
r55538 r57505 422 422 * Tests that profiler works. 423 423 */ 424 /* 425 // FIXME: disable for now. Need to change js_test.html page in Chromium repo first. 426 424 427 TestSuite.prototype.testProfilerTab = function() 425 428 { … … 461 464 this.takeControl(); 462 465 }; 466 */ 463 467 464 468
Note: See TracChangeset
for help on using the changeset viewer.