[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

loislo at chromium.org loislo at chromium.org
Wed Dec 22 14:40:19 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 57ee3f1cf0cfc9ffedbf9c4864c015e6e3aa22fc
Author: loislo at chromium.org <loislo at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 15 15:20:36 2010 +0000

    2010-10-15  Ilya Tikhonovsky  <loislo at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            Web Inspector: extract consoleMessages related stuff from populateScriptObjects into separate function.
    
            This is a part of Inspector protocol sanitization activity.
            We want to populate console messages only if it is required by frontend.
    
            https://bugs.webkit.org/show_bug.cgi?id=46802
    
            * inspector/Inspector.idl:
            * inspector/InspectorController.cpp:
            (WebCore::InspectorController::setConsoleMessagesEnabled):
            (WebCore::InspectorController::addConsoleMessage):
            (WebCore::InspectorController::disconnectFrontend):
            (WebCore::InspectorController::populateScriptObjects):
            * inspector/InspectorController.h:
            * inspector/InspectorState.cpp:
            (WebCore::InspectorState::InspectorState):
            * inspector/InspectorState.h:
            * inspector/front-end/inspector.js:
            (WebInspector.doLoadedDone):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69853 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index bf23153..d2d521f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2010-10-15  Ilya Tikhonovsky  <loislo at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: extract consoleMessages related stuff from populateScriptObjects into separate function.
+
+        This is a part of Inspector protocol sanitization activity.
+        We want to populate console messages only if it is required by frontend.
+
+        https://bugs.webkit.org/show_bug.cgi?id=46802
+
+        * inspector/Inspector.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::setConsoleMessagesEnabled):
+        (WebCore::InspectorController::addConsoleMessage):
+        (WebCore::InspectorController::disconnectFrontend):
+        (WebCore::InspectorController::populateScriptObjects):
+        * inspector/InspectorController.h:
+        * inspector/InspectorState.cpp:
+        (WebCore::InspectorState::InspectorState):
+        * inspector/InspectorState.h:
+        * inspector/front-end/inspector.js:
+        (WebInspector.doLoadedDone):
+
 2010-10-15  Ryuan Choi  <ryuan.choi at samsung.com>
 
         Reviewed by Nikolas Zimmermann.
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index 7cf5a15..c4773cf 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -32,7 +32,6 @@
 
 module core {
     interface [Conditional=INSPECTOR] Inspector {
-        [notify] void addConsoleMessage(out Object messageObj);
         [notify] void addRecordToTimeline(out Object record);
         [notify] void addNodesToSearchResult(out Array nodeIds);
         [notify] void attributesUpdated(out long id, out Array attributes);
@@ -41,7 +40,6 @@ module core {
         [notify] void childNodeCountUpdated(out long id, out int newValue);
         [notify] void childNodeInserted(out long parentId, out long prevId, out Object node);
         [notify] void childNodeRemoved(out long parentId, out long id);
-        [notify] void consoleMessagesCleared();
         [notify] void didCommitLoad();
         [notify] void evaluateForTestInFrontend(out long testCallId, out String script);
         [notify] void disconnectFromBackend();
@@ -57,8 +55,6 @@ module core {
         [notify] void showPanel(out String panel);
         [notify] void timelineProfilerWasStarted();
         [notify] void timelineProfilerWasStopped();
-        [notify] void updateConsoleMessageExpiredCount(out unsigned long count);
-        [notify] void updateConsoleMessageRepeatCount(out unsigned long count);
         [notify] void updateFocusedNode(out long nodeId);
         [notify] void updateResource(out Value resource);
 
@@ -174,7 +170,14 @@ module core {
         [handler=DOM] void searchCanceled();
         [handler=DOM] void pushNodeByPathToFrontend(in String path, out long nodeId);
 
+        [handler=Controller] void setConsoleMessagesEnabled(in boolean enabled, out boolean newState);
+        [notify] void addConsoleMessage(out Object messageObj);
+        [notify] void updateConsoleMessageExpiredCount(out unsigned long count);
+        [notify] void updateConsoleMessageRepeatCount(out unsigned long count);
+
         [handler=Controller] void clearConsoleMessages();
+        [notify] void consoleMessagesCleared();
+
         [handler=Controller] void highlightDOMNode(in long nodeId);
         [handler=Controller] void hideDOMNodeHighlight();
         [handler=Controller] void openInInspectedWindow(in String url);
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index b4358d4..32bbea6 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -318,6 +318,25 @@ void InspectorController::hideHighlight()
     m_client->hideHighlight();
 }
 
+void InspectorController::setConsoleMessagesEnabled(bool enabled, bool* newState)
+{
+    *newState = enabled;
+    setConsoleMessagesEnabled(enabled);
+}
+
+void InspectorController::setConsoleMessagesEnabled(bool enabled)
+{
+    m_state->setBoolean(InspectorState::consoleMessagesEnabled, enabled);
+    if (!enabled)
+        return;
+
+    if (m_expiredConsoleMessageCount)
+        m_frontend->updateConsoleMessageExpiredCount(m_expiredConsoleMessageCount);
+    unsigned messageCount = m_consoleMessages.size();
+    for (unsigned i = 0; i < messageCount; ++i)
+        m_consoleMessages[i]->addToFrontend(m_frontend.get(), m_injectedScriptHost.get());
+}
+
 void InspectorController::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, ScriptCallStack* callStack, const String& message)
 {
     if (!enabled())
@@ -342,12 +361,12 @@ void InspectorController::addConsoleMessage(PassOwnPtr<ConsoleMessage> consoleMe
 
     if (m_previousMessage && m_previousMessage->isEqual(consoleMessage.get())) {
         m_previousMessage->incrementCount();
-        if (m_frontend)
+        if (m_state->getBoolean(InspectorState::consoleMessagesEnabled) && m_frontend)
             m_previousMessage->updateRepeatCountInConsole(m_frontend.get());
     } else {
         m_previousMessage = consoleMessage.get();
         m_consoleMessages.append(consoleMessage);
-        if (m_frontend)
+        if (m_state->getBoolean(InspectorState::consoleMessagesEnabled) && m_frontend)
             m_previousMessage->addToFrontend(m_frontend.get(), m_injectedScriptHost.get());
     }
 
@@ -552,6 +571,9 @@ void InspectorController::disconnectFrontend()
 {
     if (!m_frontend)
         return;
+
+    setConsoleMessagesEnabled(false);
+
     m_frontend.clear();
 
     InspectorInstrumentation::frontendDeleted();
@@ -631,12 +653,6 @@ void InspectorController::populateScriptObjects()
     if (m_nodeToFocus)
         focusNode();
 
-    if (m_expiredConsoleMessageCount)
-        m_frontend->updateConsoleMessageExpiredCount(m_expiredConsoleMessageCount);
-    unsigned messageCount = m_consoleMessages.size();
-    for (unsigned i = 0; i < messageCount; ++i)
-        m_consoleMessages[i]->addToFrontend(m_frontend.get(), m_injectedScriptHost.get());
-
 #if ENABLE(DATABASE)
     DatabaseResourcesMap::iterator databasesEnd = m_databaseResources.end();
     for (DatabaseResourcesMap::iterator it = m_databaseResources.begin(); it != databasesEnd; ++it)
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 86d823e..80ebca1 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -139,13 +139,11 @@ public:
     void showPanel(const String&);
     void close();
 
-    // We are in transition from JS transport via webInspector to native
-    // transport via InspectorClient. After migration, webInspector parameter should
-    // be removed.
     void connectFrontend();
     void reuseFrontend();
     void disconnectFrontend();
 
+    void setConsoleMessagesEnabled(bool enabled, bool* newState);
     void addMessageToConsole(MessageSource, MessageType, MessageLevel, ScriptCallStack*, const String& message);
     void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceID);
     void clearConsoleMessages();
@@ -278,6 +276,7 @@ public:
 
 private:
     void getInspectorState(RefPtr<InspectorObject>* state);
+    void setConsoleMessagesEnabled(bool enabled);
 
     friend class InspectorBackend;
     friend class InspectorBackendDispatcher;
diff --git a/WebCore/inspector/InspectorState.cpp b/WebCore/inspector/InspectorState.cpp
index b731b76..c33743d 100644
--- a/WebCore/inspector/InspectorState.cpp
+++ b/WebCore/inspector/InspectorState.cpp
@@ -51,6 +51,7 @@ InspectorState::InspectorState(InspectorClient* client)
     registerBoolean(inspectorStartsAttached, true, (const char*)0, "InspectorStartsAttached");
     registerLong(inspectorAttachedHeight, InspectorController::defaultAttachedHeight, (const char*)0, "inspectorAttachedHeight");
     registerLong(pauseOnExceptionsState, 0, "pauseOnExceptionsState", (const char*)0);
+    registerBoolean(consoleMessagesEnabled, false, "consoleMessagesEnabled", (const char*)0);
 }
 
 void InspectorState::restoreFromInspectorCookie(const String& json)
diff --git a/WebCore/inspector/InspectorState.h b/WebCore/inspector/InspectorState.h
index e6e6da8..fe14d68 100644
--- a/WebCore/inspector/InspectorState.h
+++ b/WebCore/inspector/InspectorState.h
@@ -54,6 +54,7 @@ public:
         inspectorStartsAttached,
         inspectorAttachedHeight,
         pauseOnExceptionsState,
+        consoleMessagesEnabled,
         lastPropertyId
     };
 
@@ -62,6 +63,7 @@ public:
     PassRefPtr<InspectorObject> generateStateObjectForFrontend();
     void restoreFromInspectorCookie(const String& jsonString);
     void loadFromSettings();
+    String getFrontendAlias(InspectorPropertyId propertyId);
 
     bool getBoolean(InspectorPropertyId propertyId);
     String getString(InspectorPropertyId propertyId);
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 69d6fc7..87ae8a3 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -603,6 +603,7 @@ WebInspector.doLoadedDone = function()
     InspectorBackend.getInspectorState(populateInspectorState);
 
     InspectorBackend.populateScriptObjects();
+    InspectorBackend.setConsoleMessagesEnabled(true);
 
     // As a DOMAgent method, this needs to happen after the frontend has loaded and the agent is available.
     InspectorBackend.getSupportedCSSProperties(WebInspector.CSSCompletions._load);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list