Changeset 76493 in webkit


Ignore:
Timestamp:
Jan 24, 2011 2:20:57 AM (13 years ago)
Author:
yurys@chromium.org
Message:

2011-01-24 Yury Semikhatsky <yurys@chromium.org>

Reviewed by Pavel Feldman.

REGRESSION (r72895): console.trace crashes
https://bugs.webkit.org/show_bug.cgi?id=52981

  • Use local RefPtr variable for accessing PassRefPtr arguments to make sure the PassRefPtr has non-null value.
  • Use PassRefPtr for objects whos ownership is passed to the inspector.
  • GNUmakefile.am:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • inspector/InspectorConsoleInstrumentation.h: Added. Extract inline methods called from the console into their own header to reduce compilation time of other classes that depend on the inspector instrumentation. (WebCore::InspectorInstrumentation::addMessageToConsole): (WebCore::InspectorInstrumentation::consoleCount): (WebCore::InspectorInstrumentation::startConsoleTiming): (WebCore::InspectorInstrumentation::stopConsoleTiming): (WebCore::InspectorInstrumentation::consoleMarkTimeline): (WebCore::InspectorInstrumentation::addStartProfilingMessageToConsole): (WebCore::InspectorInstrumentation::addProfile): (WebCore::InspectorInstrumentation::profilerEnabled): (WebCore::InspectorInstrumentation::getCurrentUserInitiatedProfileName):
  • inspector/InspectorDatabaseInstrumentation.h: Added. Extract inline methods called from the datanase code into their own header to reduce compilation time of other classes that depend on the inspector instrumentation. (WebCore::InspectorInstrumentation::didOpenDatabase):
  • inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::addMessageToConsoleImpl): (WebCore::InspectorInstrumentation::consoleCountImpl): (WebCore::InspectorInstrumentation::stopConsoleTimingImpl): (WebCore::InspectorInstrumentation::consoleMarkTimelineImpl): (WebCore::InspectorInstrumentation::addProfileImpl): (WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
  • inspector/InspectorInstrumentation.h:
  • page/Console.cpp: use RefPtr local variable instead of accessing PassRefPtr argument directly. (WebCore::Console::addMessage): (WebCore::Console::trace): (WebCore::Console::count): (WebCore::Console::markTimeline): (WebCore::Console::profileEnd): (WebCore::Console::timeEnd): (WebCore::Console::group): (WebCore::Console::groupCollapsed):
  • storage/Database.cpp: (WebCore::Database::openDatabase):
Location:
trunk/Source/WebCore
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r76491 r76493  
     12011-01-24  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        REGRESSION (r72895): console.trace crashes
     6        https://bugs.webkit.org/show_bug.cgi?id=52981
     7
     8        - Use local RefPtr variable for accessing PassRefPtr arguments to make sure the PassRefPtr has
     9        non-null value.
     10        - Use PassRefPtr for objects whos ownership is passed to the inspector.
     11
     12        * GNUmakefile.am:
     13        * WebCore.gypi:
     14        * WebCore.pro:
     15        * WebCore.vcproj/WebCore.vcproj:
     16        * WebCore.xcodeproj/project.pbxproj:
     17        * inspector/InspectorConsoleInstrumentation.h: Added. Extract inline methods called from the console into their
     18        own header to reduce compilation time of other classes that depend on the inspector instrumentation.
     19        (WebCore::InspectorInstrumentation::addMessageToConsole):
     20        (WebCore::InspectorInstrumentation::consoleCount):
     21        (WebCore::InspectorInstrumentation::startConsoleTiming):
     22        (WebCore::InspectorInstrumentation::stopConsoleTiming):
     23        (WebCore::InspectorInstrumentation::consoleMarkTimeline):
     24        (WebCore::InspectorInstrumentation::addStartProfilingMessageToConsole):
     25        (WebCore::InspectorInstrumentation::addProfile):
     26        (WebCore::InspectorInstrumentation::profilerEnabled):
     27        (WebCore::InspectorInstrumentation::getCurrentUserInitiatedProfileName):
     28        * inspector/InspectorDatabaseInstrumentation.h: Added. Extract inline methods called from the datanase code into their
     29        own header to reduce compilation time of other classes that depend on the inspector instrumentation.
     30        (WebCore::InspectorInstrumentation::didOpenDatabase):
     31        * inspector/InspectorInstrumentation.cpp:
     32        (WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
     33        (WebCore::InspectorInstrumentation::consoleCountImpl):
     34        (WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
     35        (WebCore::InspectorInstrumentation::consoleMarkTimelineImpl):
     36        (WebCore::InspectorInstrumentation::addProfileImpl):
     37        (WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
     38        * inspector/InspectorInstrumentation.h:
     39        * page/Console.cpp: use RefPtr local variable instead of accessing PassRefPtr argument directly.
     40        (WebCore::Console::addMessage):
     41        (WebCore::Console::trace):
     42        (WebCore::Console::count):
     43        (WebCore::Console::markTimeline):
     44        (WebCore::Console::profileEnd):
     45        (WebCore::Console::timeEnd):
     46        (WebCore::Console::group):
     47        (WebCore::Console::groupCollapsed):
     48        * storage/Database.cpp:
     49        (WebCore::Database::openDatabase):
     50
    1512010-01-24  Kent Tamura  <tkent@chromium.org>
    252
  • trunk/Source/WebCore/GNUmakefile.am

    r76459 r76493  
    19641964        Source/WebCore/inspector/InspectorConsoleAgent.cpp \
    19651965        Source/WebCore/inspector/InspectorConsoleAgent.h \
     1966        Source/WebCore/inspector/InspectorConsoleInstrumentation.h \
    19661967        Source/WebCore/inspector/InspectorCSSAgent.cpp \
    19671968        Source/WebCore/inspector/InspectorCSSAgent.h \
    19681969        Source/WebCore/inspector/InspectorDatabaseAgent.cpp \
    19691970        Source/WebCore/inspector/InspectorDatabaseAgent.h \
     1971        Source/WebCore/inspector/InspectorDatabaseInstrumentation.h \
    19701972        Source/WebCore/inspector/InspectorDatabaseResource.cpp \
    19711973        Source/WebCore/inspector/InspectorDatabaseResource.h \
  • trunk/Source/WebCore/WebCore.gypi

    r76491 r76493  
    20172017            'inspector/InspectorConsoleAgent.cpp',
    20182018            'inspector/InspectorConsoleAgent.h',
     2019            'inspector/InspectorConsoleInstrumentation.h',
    20192020            'inspector/InspectorController.cpp',
    20202021            'inspector/InspectorController.h',
     
    20232024            'inspector/InspectorDatabaseAgent.cpp',
    20242025            'inspector/InspectorDatabaseAgent.h',
     2026            'inspector/InspectorDatabaseInstrumentation.h',
    20252027            'inspector/InspectorDatabaseResource.cpp',
    20262028            'inspector/InspectorDatabaseResource.h',
  • trunk/Source/WebCore/WebCore.pro

    r76466 r76493  
    19461946    inspector/InspectorBrowserDebuggerAgent.h \
    19471947    inspector/InspectorConsoleAgent.h \
     1948    inspector/InspectorConsoleInstrumentation.h \
    19481949    inspector/InspectorController.h \
    19491950    inspector/InspectorCSSAgent.h \
    19501951    inspector/InspectorDatabaseAgent.h \
     1952    inspector/InspectorDatabaseInstrumentation.h \
    19511953    inspector/InspectorDatabaseResource.h \
    19521954    inspector/InspectorDebuggerAgent.h \
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r76459 r76493  
    6511565115                        </File>
    6511665116                        <File
     65117                                RelativePath="..\inspector\InspectorConsoleInstrumentation.h"
     65118                                >
     65119                        </File>
     65120                        <File
    6511765121                                RelativePath="..\inspector\InspectorController.cpp"
    6511865122                                >
     
    6513665140                        <File
    6513765141                                RelativePath="..\inspector\InspectorDatabaseAgent.h"
     65142                                >
     65143                        </File>
     65144                        <File
     65145                                RelativePath="..\inspector\InspectorDatabaseInstrumentation.h"
    6513865146                                >
    6513965147                        </File>
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r76478 r76493  
    932932                41F0618E0F5F069800A07EAC /* ConsoleMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F0618C0F5F069800A07EAC /* ConsoleMessage.h */; };
    933933                41F0618F0F5F069800A07EAC /* ConsoleMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F0618D0F5F069800A07EAC /* ConsoleMessage.cpp */; };
     934                F3F5CF1312ED81B30084C569 /* InspectorDatabaseInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F5CF1212ED81B30084C569 /* InspectorDatabaseInstrumentation.h */; };
    934935                41F062140F5F192600A07EAC /* InspectorDatabaseResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F062120F5F192600A07EAC /* InspectorDatabaseResource.h */; };
    935936                41F062150F5F192600A07EAC /* InspectorDatabaseResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F062130F5F192600A07EAC /* InspectorDatabaseResource.cpp */; };
     
    56145615                F3335BF812E07DC300D33011 /* InspectorConsoleAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3335BF612E07DC300D33011 /* InspectorConsoleAgent.cpp */; };
    56155616                F3335BF912E07DC300D33011 /* InspectorConsoleAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F3335BF712E07DC300D33011 /* InspectorConsoleAgent.h */; };
     5617                F3F5CF1112ED81A80084C569 /* InspectorConsoleInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F5CF1012ED81A80084C569 /* InspectorConsoleInstrumentation.h */; };
    56165618                F33F0282120947F200E5743A /* ScriptProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F33F0281120947F200E5743A /* ScriptProfile.cpp */; };
    56175619                F33F053D120B0DA500E5743A /* InspectorDebuggerAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F33F053B120B0DA500E5743A /* InspectorDebuggerAgent.cpp */; };
     
    81108112                7AB0B1BE1211A62200A76940 /* InspectorDatabaseAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDatabaseAgent.cpp; sourceTree = "<group>"; };
    81118113                7AB0B1BF1211A62200A76940 /* InspectorDatabaseAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDatabaseAgent.h; sourceTree = "<group>"; };
     8114                F3F5CF1212ED81B30084C569 /* InspectorDatabaseInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDatabaseInstrumentation.h; sourceTree = "<group>"; };
    81128115                7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextMenuProvider.h; sourceTree = "<group>"; };
    81138116                7AF11A5912E727490061F23C /* InspectorRuntimeAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorRuntimeAgent.h; sourceTree = "<group>"; };
     
    1197711980                F3335BF612E07DC300D33011 /* InspectorConsoleAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorConsoleAgent.cpp; sourceTree = "<group>"; };
    1197811981                F3335BF712E07DC300D33011 /* InspectorConsoleAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorConsoleAgent.h; sourceTree = "<group>"; };
     11982                F3F5CF1012ED81A80084C569 /* InspectorConsoleInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorConsoleInstrumentation.h; sourceTree = "<group>"; };
    1197911983                F33F0281120947F200E5743A /* ScriptProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptProfile.cpp; sourceTree = "<group>"; };
    1198011984                F33F053B120B0DA500E5743A /* InspectorDebuggerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDebuggerAgent.cpp; sourceTree = "<group>"; };
     
    1298312987                                F3335BF612E07DC300D33011 /* InspectorConsoleAgent.cpp */,
    1298412988                                F3335BF712E07DC300D33011 /* InspectorConsoleAgent.h */,
     12989                                F3F5CF1012ED81A80084C569 /* InspectorConsoleInstrumentation.h */,
    1298512990                                1C81B9570E97330800266E07 /* InspectorController.cpp */,
    1298612991                                1C81B9560E97330800266E07 /* InspectorController.h */,
     
    1298912994                                7AB0B1BE1211A62200A76940 /* InspectorDatabaseAgent.cpp */,
    1299012995                                7AB0B1BF1211A62200A76940 /* InspectorDatabaseAgent.h */,
     12996                                F3F5CF1212ED81B30084C569 /* InspectorDatabaseInstrumentation.h */,
    1299112997                                41F062130F5F192600A07EAC /* InspectorDatabaseResource.cpp */,
    1299212998                                41F062120F5F192600A07EAC /* InspectorDatabaseResource.h */,
     
    2089620902                                1C81B95C0E97330800266E07 /* InspectorClient.h in Headers */,
    2089720903                                F3335BF912E07DC300D33011 /* InspectorConsoleAgent.h in Headers */,
     20904                                F3F5CF1112ED81A80084C569 /* InspectorConsoleInstrumentation.h in Headers */,
    2089820905                                1C81B95A0E97330800266E07 /* InspectorController.h in Headers */,
    2089920906                                82AB1744124B99EC00C5069D /* InspectorCSSAgent.h in Headers */,
    2090020907                                7AB0B1C11211A62200A76940 /* InspectorDatabaseAgent.h in Headers */,
     20908                                F3F5CF1312ED81B30084C569 /* InspectorDatabaseInstrumentation.h in Headers */,
    2090120909                                41F062140F5F192600A07EAC /* InspectorDatabaseResource.h in Headers */,
    2090220910                                F33F053E120B0DA500E5743A /* InspectorDebuggerAgent.h in Headers */,
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp

    r76477 r76493  
    519519}
    520520
    521 void InspectorInstrumentation::addMessageToConsoleImpl(InspectorAgent* inspectorAgent, MessageSource source, MessageType type, MessageLevel level, const String& message, ScriptArguments* arguments, ScriptCallStack* callStack)
     521void InspectorInstrumentation::addMessageToConsoleImpl(InspectorAgent* inspectorAgent, MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack)
    522522{
    523523    inspectorAgent->consoleAgent()->addMessageToConsole(source, type, level, message, arguments, callStack);
     
    529529}
    530530
    531 void InspectorInstrumentation::consoleCountImpl(InspectorAgent* inspectorAgent, ScriptArguments* arguments, ScriptCallStack* stack)
     531void InspectorInstrumentation::consoleCountImpl(InspectorAgent* inspectorAgent, PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> stack)
    532532{
    533533    inspectorAgent->consoleAgent()->count(arguments, stack);
     
    539539}
    540540
    541 void InspectorInstrumentation::stopConsoleTimingImpl(InspectorAgent* inspectorAgent, const String& title, ScriptCallStack* stack)
     541void InspectorInstrumentation::stopConsoleTimingImpl(InspectorAgent* inspectorAgent, const String& title, PassRefPtr<ScriptCallStack> stack)
    542542{
    543543    inspectorAgent->consoleAgent()->stopTiming(title, stack);
    544544}
    545545
    546 void InspectorInstrumentation::consoleMarkTimelineImpl(InspectorAgent* inspectorAgent, ScriptArguments* arguments)
     546void InspectorInstrumentation::consoleMarkTimelineImpl(InspectorAgent* inspectorAgent, PassRefPtr<ScriptArguments> arguments)
    547547{
    548548    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorAgent)) {
     
    560560}
    561561
    562 void InspectorInstrumentation::addProfileImpl(InspectorAgent* inspectorAgent, RefPtr<ScriptProfile> profile, ScriptCallStack* callStack)
     562void InspectorInstrumentation::addProfileImpl(InspectorAgent* inspectorAgent, RefPtr<ScriptProfile> profile, PassRefPtr<ScriptCallStack> callStack)
    563563{
    564564    if (InspectorProfilerAgent* profilerAgent = inspectorAgent->profilerAgent()) {
     
    589589
    590590#if ENABLE(DATABASE)
    591 void InspectorInstrumentation::didOpenDatabaseImpl(InspectorAgent* inspectorAgent, Database* database, const String& domain, const String& name, const String& version)
     591void InspectorInstrumentation::didOpenDatabaseImpl(InspectorAgent* inspectorAgent, PassRefPtr<Database> database, const String& domain, const String& name, const String& version)
    592592{
    593593    inspectorAgent->didOpenDatabase(database, domain, name, version);
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.h

    r76477 r76493  
    3636#include "Page.h"
    3737#include "ScriptExecutionContext.h"
    38 
    3938#include <wtf/HashMap.h>
    40 #include <wtf/PassRefPtr.h>
    4139
    4240namespace WebCore {
     
    132130    static void didWriteHTML(const InspectorInstrumentationCookie&, unsigned int endLine);
    133131
    134     static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, ScriptArguments*, ScriptCallStack*);
     132    static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
    135133    static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String&);
    136     static void consoleCount(Page*, ScriptArguments*, ScriptCallStack*);
     134    static void consoleCount(Page*, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
    137135    static void startConsoleTiming(Page*, const String& title);
    138     static void stopConsoleTiming(Page*, const String& title, ScriptCallStack*);
    139     static void consoleMarkTimeline(Page*, ScriptArguments*);
     136    static void stopConsoleTiming(Page*, const String& title, PassRefPtr<ScriptCallStack>);
     137    static void consoleMarkTimeline(Page*, PassRefPtr<ScriptArguments>);
    140138
    141139#if ENABLE(JAVASCRIPT_DEBUGGER)
    142140    static void addStartProfilingMessageToConsole(Page*, const String& title, unsigned lineNumber, const String& sourceURL);
    143     static void addProfile(Page*, RefPtr<ScriptProfile>, ScriptCallStack*);
     141    static void addProfile(Page*, RefPtr<ScriptProfile>, PassRefPtr<ScriptCallStack>);
    144142    static bool profilerEnabled(Page*);
    145143    static String getCurrentUserInitiatedProfileName(Page*, bool incrementProfileNumber);
     
    147145
    148146#if ENABLE(DATABASE)
    149     static void didOpenDatabase(ScriptExecutionContext*, Database*, const String& domain, const String& name, const String& version);
     147    static void didOpenDatabase(ScriptExecutionContext*, PassRefPtr<Database>, const String& domain, const String& name, const String& version);
    150148#endif
    151149
     
    244242    static void didWriteHTMLImpl(const InspectorInstrumentationCookie&, unsigned int endLine);
    245243
    246     static void addMessageToConsoleImpl(InspectorAgent*, MessageSource, MessageType, MessageLevel, const String& message, ScriptArguments*, ScriptCallStack*);
     244    static void addMessageToConsoleImpl(InspectorAgent*, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
    247245    static void addMessageToConsoleImpl(InspectorAgent*, MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceID);
    248     static void consoleCountImpl(InspectorAgent*, ScriptArguments*, ScriptCallStack*);
     246    static void consoleCountImpl(InspectorAgent*, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
    249247    static void startConsoleTimingImpl(InspectorAgent*, const String& title);
    250     static void stopConsoleTimingImpl(InspectorAgent*, const String& title, ScriptCallStack*);
    251     static void consoleMarkTimelineImpl(InspectorAgent*, ScriptArguments*);
     248    static void stopConsoleTimingImpl(InspectorAgent*, const String& title, PassRefPtr<ScriptCallStack>);
     249    static void consoleMarkTimelineImpl(InspectorAgent*, PassRefPtr<ScriptArguments>);
    252250
    253251#if ENABLE(JAVASCRIPT_DEBUGGER)
    254252    static void addStartProfilingMessageToConsoleImpl(InspectorAgent*, const String& title, unsigned lineNumber, const String& sourceURL);
    255     static void addProfileImpl(InspectorAgent*, RefPtr<ScriptProfile>, ScriptCallStack*);
     253    static void addProfileImpl(InspectorAgent*, RefPtr<ScriptProfile>, PassRefPtr<ScriptCallStack>);
    256254    static bool profilerEnabledImpl(InspectorAgent*);
    257255    static String getCurrentUserInitiatedProfileNameImpl(InspectorAgent*, bool incrementProfileNumber);
     
    259257
    260258#if ENABLE(DATABASE)
    261     static void didOpenDatabaseImpl(InspectorAgent*, Database*, const String& domain, const String& name, const String& version);
     259    static void didOpenDatabaseImpl(InspectorAgent*, PassRefPtr<Database>, const String& domain, const String& name, const String& version);
    262260#endif
    263261
     
    745743}
    746744
    747 #if ENABLE(DATABASE)
    748 inline void InspectorInstrumentation::didOpenDatabase(ScriptExecutionContext* context, Database* database, const String& domain, const String& name, const String& version)
    749 {
    750 #if ENABLE(INSPECTOR)
    751     if (InspectorAgent* inspectorAgent = inspectorAgentForContext(context))
    752         didOpenDatabaseImpl(inspectorAgent, database, domain, name, version);
    753 #endif
    754 }
    755 #endif
    756 
    757745#if ENABLE(DOM_STORAGE)
    758746inline void InspectorInstrumentation::didUseDOMStorage(Page* page, StorageArea* storageArea, bool isLocalStorage, Frame* frame)
     
    833821        updateApplicationCacheStatusImpl(inspectorAgent, frame);
    834822#endif
    835 }
    836 #endif
    837 
    838 inline void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, ScriptArguments* arguments, ScriptCallStack* callStack)
    839 {
    840 #if ENABLE(INSPECTOR)
    841     if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
    842         addMessageToConsoleImpl(inspectorAgent, source, type, level, message, arguments, callStack);
    843 #endif
    844 }
    845 
    846 inline void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID)
    847 {
    848 #if ENABLE(INSPECTOR)
    849     if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
    850         addMessageToConsoleImpl(inspectorAgent, source, type, level, message, lineNumber, sourceID);
    851 #endif
    852 }
    853 
    854 inline void InspectorInstrumentation::consoleCount(Page* page, ScriptArguments* arguments, ScriptCallStack* stack)
    855 {
    856 #if ENABLE(INSPECTOR)
    857     if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
    858         consoleCountImpl(inspectorAgent, arguments, stack);
    859 #endif
    860 }
    861 
    862 inline void InspectorInstrumentation::startConsoleTiming(Page* page, const String& title)
    863 {
    864 #if ENABLE(INSPECTOR)
    865     if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
    866         startConsoleTimingImpl(inspectorAgent, title);
    867 #endif
    868 }
    869 
    870 inline void InspectorInstrumentation::stopConsoleTiming(Page* page, const String& title, ScriptCallStack* stack)
    871 {
    872 #if ENABLE(INSPECTOR)
    873     if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
    874         stopConsoleTimingImpl(inspectorAgent, title, stack);
    875 #endif
    876 }
    877 
    878 inline void InspectorInstrumentation::consoleMarkTimeline(Page* page, ScriptArguments* arguments)
    879 {
    880 #if ENABLE(INSPECTOR)
    881     if (InspectorAgent* inspectorAgent = inspectorAgentWithFrontendForPage(page))
    882         consoleMarkTimelineImpl(inspectorAgent, arguments);
    883 #endif
    884 }
    885 
    886 #if ENABLE(JAVASCRIPT_DEBUGGER)
    887 inline void InspectorInstrumentation::addStartProfilingMessageToConsole(Page* page, const String& title, unsigned lineNumber, const String& sourceURL)
    888 {
    889 #if ENABLE(INSPECTOR)
    890     if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
    891         addStartProfilingMessageToConsoleImpl(inspectorAgent, title, lineNumber, sourceURL);
    892 #endif
    893 }
    894 
    895 inline void InspectorInstrumentation::addProfile(Page* page, RefPtr<ScriptProfile> profile, ScriptCallStack* callStack)
    896 {
    897 #if ENABLE(INSPECTOR)
    898     if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
    899         addProfileImpl(inspectorAgent, profile, callStack);
    900 #endif
    901 }
    902 
    903 inline bool InspectorInstrumentation::profilerEnabled(Page* page)
    904 {
    905 #if ENABLE(INSPECTOR)
    906     if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
    907         return profilerEnabledImpl(inspectorAgent);
    908 #endif
    909     return false;
    910 }
    911 
    912 inline String InspectorInstrumentation::getCurrentUserInitiatedProfileName(Page* page, bool incrementProfileNumber)
    913 {
    914 #if ENABLE(INSPECTOR)
    915     if (InspectorAgent* inspectorAgent = inspectorAgentForPage(page))
    916         return InspectorInstrumentation::getCurrentUserInitiatedProfileNameImpl(inspectorAgent, incrementProfileNumber);
    917 #endif
    918     return "";
    919823}
    920824#endif
  • trunk/Source/WebCore/page/Console.cpp

    r76344 r76493  
    3535#include "FrameLoader.h"
    3636#include "FrameTree.h"
     37#include "InspectorConsoleInstrumentation.h"
    3738#include "InspectorController.h"
    38 #include "InspectorInstrumentation.h"
    3939#include "MemoryInfo.h"
    4040#include "Page.h"
     
    148148
    149149    if (callStack)
    150         InspectorInstrumentation::addMessageToConsole(page, source, type, level, message, 0, callStack.get());
     150        InspectorInstrumentation::addMessageToConsole(page, source, type, level, message, 0, callStack);
    151151    else
    152152        InspectorInstrumentation::addMessageToConsole(page, source, type, level, message, lineNumber, sourceURL);
     
    161161}
    162162
    163 void Console::addMessage(MessageType type, MessageLevel level, PassRefPtr<ScriptArguments> arguments,  PassRefPtr<ScriptCallStack> callStack, bool acceptNoArguments)
    164 {
     163void Console::addMessage(MessageType type, MessageLevel level, PassRefPtr<ScriptArguments> prpArguments,  PassRefPtr<ScriptCallStack> prpCallStack, bool acceptNoArguments)
     164{
     165    RefPtr<ScriptArguments> arguments = prpArguments;
     166    RefPtr<ScriptCallStack> callStack = prpCallStack;
     167
    165168    Page* page = this->page();
    166169    if (!page)
     
    188191        page->chrome()->client()->addMessageToConsole(JSMessageSource, type, level, message, lastCaller.lineNumber(), lastCaller.sourceURL());
    189192
    190     InspectorInstrumentation::addMessageToConsole(page, JSMessageSource, type, level, message, arguments.get(), callStack.get());
     193    InspectorInstrumentation::addMessageToConsole(page, JSMessageSource, type, level, message, arguments, callStack);
    191194}
    192195
     
    223226}
    224227
    225 void Console::trace(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack)
    226 {
     228void Console::trace(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> prpCallStack)
     229{
     230    RefPtr<ScriptCallStack> callStack = prpCallStack;
    227231    addMessage(TraceMessageType, LogMessageLevel, arguments, callStack, true);
    228232
     
    247251void Console::count(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack)
    248252{
    249     InspectorInstrumentation::consoleCount(page(), arguments.get(), callStack.get());
     253    InspectorInstrumentation::consoleCount(page(), arguments, callStack);
    250254}
    251255
    252256void Console::markTimeline(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack>)
    253257{
    254     InspectorInstrumentation::consoleMarkTimeline(page(), arguments.get());
     258    InspectorInstrumentation::consoleMarkTimeline(page(), arguments);
    255259}
    256260
     
    291295
    292296    m_profiles.append(profile);
    293     InspectorInstrumentation::addProfile(page, profile, callStack.get());
     297    InspectorInstrumentation::addProfile(page, profile, callStack);
    294298}
    295299
     
    303307void Console::timeEnd(const String& title, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack> callStack)
    304308{
    305     InspectorInstrumentation::stopConsoleTiming(page(), title, callStack.get());
     309    InspectorInstrumentation::stopConsoleTiming(page(), title, callStack);
    306310}
    307311
    308312void Console::group(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack)
    309313{
    310     InspectorInstrumentation::addMessageToConsole(page(), JSMessageSource, StartGroupMessageType, LogMessageLevel, String(), arguments.get(), callStack.get());
     314    InspectorInstrumentation::addMessageToConsole(page(), JSMessageSource, StartGroupMessageType, LogMessageLevel, String(), arguments, callStack);
    311315}
    312316
    313317void Console::groupCollapsed(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack)
    314318{
    315     InspectorInstrumentation::addMessageToConsole(page(), JSMessageSource, StartGroupCollapsedMessageType, LogMessageLevel, String(), arguments.get(), callStack.get());
     319    InspectorInstrumentation::addMessageToConsole(page(), JSMessageSource, StartGroupCollapsedMessageType, LogMessageLevel, String(), arguments, callStack);
    316320}
    317321
  • trunk/Source/WebCore/storage/Database.cpp

    r75932 r76493  
    3737#include "DatabaseTracker.h"
    3838#include "Document.h"
    39 #include "InspectorInstrumentation.h"
     39#include "InspectorDatabaseInstrumentation.h"
    4040#include "Logging.h"
    4141#include "NotImplemented.h"
     
    108108    context->setHasOpenDatabases();
    109109
    110     InspectorInstrumentation::didOpenDatabase(context, database.get(), context->securityOrigin()->host(), name, expectedVersion);
     110    InspectorInstrumentation::didOpenDatabase(context, database, context->securityOrigin()->host(), name, expectedVersion);
    111111
    112112    // If it's a new database and a creation callback was provided, reset the expected
Note: See TracChangeset for help on using the changeset viewer.