Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (120700 => 120701)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-06-19 10:18:21 UTC (rev 120700)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-06-19 10:27:45 UTC (rev 120701)
@@ -1,3 +1,28 @@
+2012-06-19 Yury Semikhatsky <[email protected]>
+
+ [Chromium] Web Inspector: remove unnecessary indirection from message loop instrumentation
+ https://bugs.webkit.org/show_bug.cgi?id=89443
+
+ Removed start/stopMainThreadMonitoring methods from WebDevToolsAgentClient
+ and WebDevToolsAgentImpl. The functionality is now implemented inside
+ InspectorClientImpl.
+
+ Reviewed by Vsevolod Vlasov.
+
+ * public/WebDevToolsAgentClient.h:
+ * src/InspectorClientImpl.cpp:
+ (WebKit::InspectorClientImpl::clearBrowserCookies):
+ (WebKit::InspectorClientImpl::startMainThreadMonitoring):
+ (WebKit::InspectorClientImpl::stopMainThreadMonitoring):
+ (WebKit::InspectorClientImpl::willProcessTask):
+ (WebKit):
+ (WebKit::InspectorClientImpl::didProcessTask):
+ * src/InspectorClientImpl.h:
+ (InspectorClientImpl):
+ * src/WebDevToolsAgentImpl.cpp:
+ * src/WebDevToolsAgentImpl.h:
+ (WebDevToolsAgentImpl):
+
2012-06-19 Mike West <[email protected]>
Introduce ENABLE_CSP_NEXT configuration flag.
Modified: trunk/Source/WebKit/chromium/public/WebDevToolsAgentClient.h (120700 => 120701)
--- trunk/Source/WebKit/chromium/public/WebDevToolsAgentClient.h 2012-06-19 10:18:21 UTC (rev 120700)
+++ trunk/Source/WebKit/chromium/public/WebDevToolsAgentClient.h 2012-06-19 10:27:45 UTC (rev 120701)
@@ -58,13 +58,6 @@
};
virtual WebKitClientMessageLoop* createClientMessageLoop() { return 0; }
- // Add task observer to main thread. Corresponding WebDevToolsAgent
- // should be notified about beginning and finishing of task processing.
- virtual void startMainThreadMonitoring() { }
-
- // Remove task observer added by "startMainThreadMonitoring".
- virtual void stopMainThreadMonitoring() { }
-
virtual void clearBrowserCache() { }
virtual void clearBrowserCookies() { }
Modified: trunk/Source/WebKit/chromium/src/InspectorClientImpl.cpp (120700 => 120701)
--- trunk/Source/WebKit/chromium/src/InspectorClientImpl.cpp 2012-06-19 10:18:21 UTC (rev 120700)
+++ trunk/Source/WebKit/chromium/src/InspectorClientImpl.cpp 2012-06-19 10:27:45 UTC (rev 120701)
@@ -33,6 +33,7 @@
#include "DOMWindow.h"
#include "FloatRect.h"
+#include "InspectorInstrumentation.h"
#include "NotImplemented.h"
#include "Page.h"
#include "WebDevToolsAgentImpl.h"
@@ -41,6 +42,7 @@
#include "platform/WebURLRequest.h"
#include "WebViewClient.h"
#include "WebViewImpl.h"
+#include <public/Platform.h>
#include <wtf/Vector.h>
using namespace WebCore;
@@ -130,14 +132,12 @@
void InspectorClientImpl::startMainThreadMonitoring()
{
- if (WebDevToolsAgentImpl* agent = devToolsAgent())
- agent->startMainThreadMonitoring();
+ WebKit::Platform::current()->currentThread()->addTaskObserver(this);
}
void InspectorClientImpl::stopMainThreadMonitoring()
{
- if (WebDevToolsAgentImpl* agent = devToolsAgent())
- agent->stopMainThreadMonitoring();
+ WebKit::Platform::current()->currentThread()->removeTaskObserver(this);
}
bool InspectorClientImpl::canOverrideDeviceMetrics()
@@ -162,6 +162,16 @@
return true;
}
+void InspectorClientImpl::willProcessTask()
+{
+ InspectorInstrumentation::willProcessTask(m_inspectedWebView->page());
+}
+
+void InspectorClientImpl::didProcessTask()
+{
+ InspectorInstrumentation::didProcessTask(m_inspectedWebView->page());
+}
+
WebDevToolsAgentImpl* InspectorClientImpl::devToolsAgent()
{
return static_cast<WebDevToolsAgentImpl*>(m_inspectedWebView->devToolsAgent());
Modified: trunk/Source/WebKit/chromium/src/InspectorClientImpl.h (120700 => 120701)
--- trunk/Source/WebKit/chromium/src/InspectorClientImpl.h 2012-06-19 10:18:21 UTC (rev 120700)
+++ trunk/Source/WebKit/chromium/src/InspectorClientImpl.h 2012-06-19 10:27:45 UTC (rev 120701)
@@ -33,6 +33,7 @@
#include "InspectorClient.h"
#include "InspectorController.h"
+#include "platform/WebThread.h"
#include <wtf/OwnPtr.h>
namespace WebKit {
@@ -41,7 +42,8 @@
class WebDevToolsAgentImpl;
class WebViewImpl;
-class InspectorClientImpl : public WebCore::InspectorClient {
+class InspectorClientImpl : public WebCore::InspectorClient,
+ public WebThread::TaskObserver {
public:
InspectorClientImpl(WebViewImpl*);
~InspectorClientImpl();
@@ -74,6 +76,10 @@
virtual bool supportsFrameInstrumentation();
private:
+ // WebThread::TaskObserver
+ virtual void willProcessTask();
+ virtual void didProcessTask();
+
WebDevToolsAgentImpl* devToolsAgent();
// The WebViewImpl of the page being inspected; gets passed to the constructor
Modified: trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp (120700 => 120701)
--- trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp 2012-06-19 10:18:21 UTC (rev 120700)
+++ trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp 2012-06-19 10:27:45 UTC (rev 120701)
@@ -39,7 +39,6 @@
#include "InspectorBackendDispatcher.h"
#include "InspectorController.h"
#include "InspectorFrontend.h"
-#include "InspectorInstrumentation.h"
#include "InspectorProtocolVersion.h"
#include "MemoryCache.h"
#include "Page.h"
@@ -65,7 +64,6 @@
#include "platform/WebURLResponse.h"
#include "WebViewClient.h"
#include "WebViewImpl.h"
-#include <public/Platform.h>
#include <wtf/CurrentTime.h>
#include <wtf/MathExtras.h>
#include <wtf/Noncopyable.h>
@@ -547,28 +545,6 @@
m_client->clearBrowserCookies();
}
-void WebDevToolsAgentImpl::startMainThreadMonitoring()
-{
- WebKit::Platform::current()->currentThread()->addTaskObserver(this);
-}
-
-void WebDevToolsAgentImpl::stopMainThreadMonitoring()
-{
- WebKit::Platform::current()->currentThread()->removeTaskObserver(this);
-}
-
-void WebDevToolsAgentImpl::willProcessTask()
-{
- if (Page* page = m_webViewImpl->page())
- InspectorInstrumentation::willProcessTask(page);
-}
-
-void WebDevToolsAgentImpl::didProcessTask()
-{
- if (Page* page = m_webViewImpl->page())
- InspectorInstrumentation::didProcessTask(page);
-}
-
void WebDevToolsAgentImpl::setProcessId(long processId)
{
inspectorController()->setProcessId(processId);
Modified: trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h (120700 => 120701)
--- trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h 2012-06-19 10:18:21 UTC (rev 120700)
+++ trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h 2012-06-19 10:27:45 UTC (rev 120701)
@@ -36,7 +36,6 @@
#include "WebDevToolsAgentPrivate.h"
#include "WebPageOverlay.h"
#include "platform/WebSize.h"
-#include "platform/WebThread.h"
#include <wtf/Forward.h>
#include <wtf/OwnPtr.h>
@@ -66,8 +65,7 @@
class WebDevToolsAgentImpl : public WebDevToolsAgentPrivate,
public WebCore::InspectorClient,
- public WebPageOverlay,
- public WebThread::TaskObserver {
+ public WebPageOverlay {
public:
WebDevToolsAgentImpl(WebViewImpl* webViewImpl, WebDevToolsAgentClient* client);
virtual ~WebDevToolsAgentImpl();
@@ -102,9 +100,6 @@
virtual void clearBrowserCache();
virtual void clearBrowserCookies();
- virtual void startMainThreadMonitoring();
- virtual void stopMainThreadMonitoring();
-
virtual void overrideDeviceMetrics(int width, int height, float fontScaleFactor, bool fitWindow);
virtual void autoZoomPageToFitWidth();
@@ -113,10 +108,6 @@
// WebPageOverlay
virtual void paintPageOverlay(WebCanvas*);
- // WebThread::TaskObserver
- virtual void willProcessTask();
- virtual void didProcessTask();
-
private:
WebCore::InspectorController* inspectorController();
WebCore::Frame* mainFrame();