Ignore:
Timestamp:
Sep 29, 2014, 8:34:11 PM (11 years ago)
Author:
Brian Burg
Message:

Web Inspector: InjectedScripts should not be profiled or displayed in Timeline
https://bugs.webkit.org/show_bug.cgi?id=136806

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

It doesn't make sense to show profile nodes for injected scripts when profiling user content.
For now, omit nodes by suspending profiling before and after executing injected scripts.

  • profiler/LegacyProfiler.cpp:

(JSC::LegacyProfiler::suspendProfiling): Added.
(JSC::LegacyProfiler::unsuspendProfiling): Added.

  • profiler/LegacyProfiler.h:
  • profiler/ProfileGenerator.cpp: Add isSuspended() flag, remove unused typedef.

(JSC::ProfileGenerator::ProfileGenerator):
(JSC::ProfileGenerator::willExecute):
(JSC::ProfileGenerator::didExecute):

  • profiler/ProfileGenerator.h:

(JSC::ProfileGenerator::setIsSuspended): Added.

Source/WebCore:

Instead of creating timeline records for injected scripts, suspend profiling
of the current page before and after calling injected script functions.

  • inspector/InspectorController.cpp:

(WebCore::InspectorController::willCallInjectedScriptFunction):
(WebCore::InspectorController::didCallInjectedScriptFunction):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/profiler/LegacyProfiler.h

    r173264 r174095  
    5656    void stopProfiling(JSGlobalObject*);
    5757
     58    // Used to ignore profile node subtrees rooted at InjectedScript calls.
     59    JS_EXPORT_PRIVATE void suspendProfiling(ExecState*);
     60    JS_EXPORT_PRIVATE void unsuspendProfiling(ExecState*);
     61
    5862    void willExecute(ExecState* callerCallFrame, JSValue function);
    5963    void willExecute(ExecState* callerCallFrame, const WTF::String& sourceURL, unsigned startingLineNumber, unsigned startingColumnNumber);
Note: See TracChangeset for help on using the changeset viewer.