Web Inspector: Disabling Inspector causes build failure on Windows
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2012 12:26:33 +0000 (12:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2012 12:26:33 +0000 (12:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83557

Patch by Vivek Galatage <vivekgalatage@gmail.com> on 2012-04-18
Reviewed by Pavel Feldman.

The calls to inspector APIs are not put under ENABLE(INSPECTOR) guard.
This change brings all such API calls under the guard.

Source/WebKit/win:

* WebCoreSupport/WebInspectorClient.cpp:
* WebInspector.cpp:
* WebNodeHighlight.cpp:
(WebNodeHighlight::WebNodeHighlight):
(WebNodeHighlight::update):
* WebNodeHighlight.h:
(WebNodeHighlight):
* WebView.cpp:
(WebView::WebView):
(WebView::close):
(WebView::initWithFrame):
(WebView::inspector):
* WebView.h:
(WebView):

Tools:

* WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
(WTR::LayoutTestController::showWebInspector):
(WTR::LayoutTestController::closeWebInspector):
(WTR::LayoutTestController::evaluateInWebInspector):
(WTR::LayoutTestController::setJavaScriptProfilingEnabled):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::invoke):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114499 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
Source/WebKit/win/WebInspector.cpp
Source/WebKit/win/WebNodeHighlight.cpp
Source/WebKit/win/WebNodeHighlight.h
Source/WebKit/win/WebView.cpp
Source/WebKit/win/WebView.h
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
Tools/WebKitTestRunner/TestInvocation.cpp

index bd8474c..9adb53a 100644 (file)
@@ -1,3 +1,28 @@
+2012-04-18  Vivek Galatage  <vivekgalatage@gmail.com>
+
+        Web Inspector: Disabling Inspector causes build failure on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=83557
+
+        Reviewed by Pavel Feldman.
+
+        The calls to inspector APIs are not put under ENABLE(INSPECTOR) guard.
+        This change brings all such API calls under the guard.
+
+        * WebCoreSupport/WebInspectorClient.cpp:
+        * WebInspector.cpp:
+        * WebNodeHighlight.cpp:
+        (WebNodeHighlight::WebNodeHighlight):
+        (WebNodeHighlight::update):
+        * WebNodeHighlight.h:
+        (WebNodeHighlight):
+        * WebView.cpp:
+        (WebView::WebView):
+        (WebView::close):
+        (WebView::initWithFrame):
+        (WebView::inspector):
+        * WebView.h:
+        (WebView):
+
 2012-04-11  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r113836.
index 03d3a5e..0355282 100644 (file)
@@ -29,6 +29,8 @@
 #include "config.h"
 #include "WebInspectorClient.h"
 
+#if ENABLE(INSPECTOR)
+
 #include "WebInspectorDelegate.h"
 #include "WebKit.h"
 #include "WebMutableURLRequest.h"
@@ -546,3 +548,5 @@ static ATOM registerWindowClass()
 
     return ::RegisterClassEx(&wcex);
 }
+
+#endif // ENABLE(INSPECTOR)
index 17f6f07..39c7527 100644 (file)
@@ -29,6 +29,8 @@
 #include "config.h"
 #include "WebInspector.h"
 
+#if ENABLE(INSPECTOR)
+
 #include "WebInspectorClient.h"
 #include "WebKitDLL.h"
 #include "WebView.h"
@@ -276,3 +278,5 @@ HRESULT STDMETHODCALLTYPE WebInspector::setTimelineProfilingEnabled(BOOL enabled
     frontendClient()->setTimelineProfilingEnabled(enabled);
     return S_OK;
 }
+
+#endif // ENABLE(INSPECTOR)
index c35d0b6..182ae72 100644 (file)
@@ -47,12 +47,17 @@ static ATOM registerOverlayClass();
 static LPCTSTR kWebNodeHighlightPointerProp = TEXT("WebNodeHighlightPointer");
 
 WebNodeHighlight::WebNodeHighlight(WebView* webView)
-    : m_inspectedWebView(webView)
-    , m_overlay(0)
+    : 
+#if ENABLE(INSPECTOR)    
+      m_inspectedWebView(webView),
+#endif // ENABLE(INSPECTOR)
+      m_overlay(0)
     , m_observedWindow(0)
     , m_showsWhileWebViewIsVisible(false)
 {
+#if ENABLE(INSPECTOR)
     m_inspectedWebView->viewWindow(reinterpret_cast<OLE_HANDLE*>(&m_inspectedWebViewWindow));
+#endif // ENABLE(INSPECTOR)
 }
 
 WebNodeHighlight::~WebNodeHighlight()
@@ -158,8 +163,9 @@ void WebNodeHighlight::update()
     ::SelectObject(hdc, hbmp.get());
 
     GraphicsContext context(hdc);
-
+#if ENABLE(INSPECTOR)
     m_inspectedWebView->page()->inspectorController()->drawHighlight(context);
+#endif // ENABLE(INSPECTOR)
 
     BLENDFUNCTION bf;
     bf.BlendOp = AC_SRC_OVER;
index 1d154f9..da2faa6 100644 (file)
@@ -59,7 +59,9 @@ private:
     void onWebViewWindowPosChanged(WINDOWPOS*);
     void onRootWindowPosChanged(WINDOWPOS*);
 
+#if ENABLE(INSPECTOR)
     WebView* m_inspectedWebView;
+#endif // ENABLE(INSPECTOR)
     HWND m_inspectedWebViewWindow;
     HWND m_overlay;
     HWND m_observedWindow;
index e1ab0cc..015e0a4 100644 (file)
@@ -337,7 +337,9 @@ WebView::WebView()
     , m_viewWindow(0)
     , m_mainFrame(0)
     , m_page(0)
+#if ENABLE(INSPECTOR)
     , m_inspectorClient(0)
+#endif // ENABLE(INSPECTOR)
     , m_hasCustomDropTarget(false)
     , m_useBackForwardList(true)
     , m_userAgentOverridden(false)
@@ -710,9 +712,11 @@ HRESULT STDMETHODCALLTYPE WebView::close()
     setUIDelegate(0);
     setFormDelegate(0);
 
+#if ENABLE(INSPECTOR)
     m_inspectorClient = 0;
     if (m_webInspector)
         m_webInspector->webViewClosed();
+#endif // ENABLE(INSPECTOR)
 
     delete m_page;
     m_page = 0;
@@ -2658,14 +2662,19 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame(
     if (SUCCEEDED(m_preferences->shouldUseHighResolutionTimers(&useHighResolutionTimer)))
         Settings::setShouldUseHighResolutionTimers(useHighResolutionTimer);
 
+#if ENABLE(INSPECTOR)
     m_inspectorClient = new WebInspectorClient(this);
+#endif // ENABLE(INSPECTOR)
 
     Page::PageClients pageClients;
     pageClients.chromeClient = new WebChromeClient(this);
     pageClients.contextMenuClient = new WebContextMenuClient(this);
     pageClients.editorClient = new WebEditorClient(this);
     pageClients.dragClient = new WebDragClient(this);
+#if ENABLE(INSPECTOR)
     pageClients.inspectorClient = m_inspectorClient;
+#endif // ENABLE(INSPECTOR)
+
     m_page = new Page(pageClients);
     provideGeolocationTo(m_page, new WebGeolocationClient(this));
 
@@ -5771,12 +5780,17 @@ bool WebView::onIMESetContext(WPARAM wparam, LPARAM)
 
 HRESULT STDMETHODCALLTYPE WebView::inspector(IWebInspector** inspector)
 {
+#if ENABLE(INSPECTOR)
     if (!m_webInspector)
         m_webInspector.adoptRef(WebInspector::createInstance(this, m_inspectorClient));
 
     return m_webInspector.copyRefTo(inspector);
+#else // !ENABLE(INSPECTOR)
+    return S_OK;
+#endif // ENABLE(INSPECTOR)
 }
 
+
 HRESULT STDMETHODCALLTYPE WebView::windowAncestryDidChange()
 {
     HWND newParent;
index 30843d3..3a0f95a 100644 (file)
@@ -704,7 +704,7 @@ public:
 
     virtual HRESULT STDMETHODCALLTYPE loadBackForwardListFromOtherView( 
         /* [in] */ IWebView *otherView);
-
+        
     virtual HRESULT STDMETHODCALLTYPE inspector(
         /* [retval][out] */ IWebInspector**);
 
@@ -1047,7 +1047,9 @@ protected:
     HWND m_viewWindow;
     WebFrame* m_mainFrame;
     WebCore::Page* m_page;
+#if ENABLE(INSPECTOR)
     WebInspectorClient* m_inspectorClient;
+#endif // ENABLE(INSPECTOR)
     
     RefPtr<RefCountedHBITMAP> m_backingStoreBitmap;
     SIZE m_backingStoreSize;
@@ -1064,7 +1066,9 @@ protected:
     COMPtr<IWebDownloadDelegate> m_downloadDelegate;
     COMPtr<IWebHistoryDelegate> m_historyDelegate;
     COMPtr<WebPreferences> m_preferences;
+#if ENABLE(INSPECTOR)
     COMPtr<WebInspector> m_webInspector;
+#endif // ENABLE(INSPECTOR)
     COMPtr<IWebGeolocationProvider> m_geolocationProvider;
 
     bool m_userAgentOverridden;
index 04a25f0..61eed93 100644 (file)
@@ -1,3 +1,21 @@
+2012-04-18  Vivek Galatage  <vivekgalatage@gmail.com>
+
+        Web Inspector: Disabling Inspector causes build failure on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=83557
+
+        Reviewed by Pavel Feldman.
+
+        The calls to inspector APIs are not put under ENABLE(INSPECTOR) guard.
+        This change brings all such API calls under the guard.
+
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+        (WTR::LayoutTestController::showWebInspector):
+        (WTR::LayoutTestController::closeWebInspector):
+        (WTR::LayoutTestController::evaluateInWebInspector):
+        (WTR::LayoutTestController::setJavaScriptProfilingEnabled):
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::invoke):
+
 2012-04-18  Mario Sanchez Prada  <msanchez@igalia.com>
 
         [GTK] atk/textChangedNotifications API test fails
index e31ac87..292b449 100644 (file)
@@ -460,23 +460,31 @@ void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef wi
 
 void LayoutTestController::showWebInspector()
 {
+#if ENABLE(INSPECTOR)
     WKBundleInspectorShow(WKBundlePageGetInspector(InjectedBundle::shared().page()->page()));
+#endif // ENABLE(INSPECTOR)
 }
 
 void LayoutTestController::closeWebInspector()
 {
+#if ENABLE(INSPECTOR)
     WKBundleInspectorClose(WKBundlePageGetInspector(InjectedBundle::shared().page()->page()));
+#endif // ENABLE(INSPECTOR)
 }
 
 void LayoutTestController::evaluateInWebInspector(long callID, JSStringRef script)
 {
+#if ENABLE(INSPECTOR)
     WKRetainPtr<WKStringRef> scriptWK = toWK(script);
     WKBundleInspectorEvaluateScriptForTest(WKBundlePageGetInspector(InjectedBundle::shared().page()->page()), callID, scriptWK.get());
+#endif // ENABLE(INSPECTOR)
 }
 
 void LayoutTestController::setJavaScriptProfilingEnabled(bool enabled)
 {
+#if ENABLE(INSPECTOR)
     WKBundleInspectorSetJavaScriptProfilingEnabled(WKBundlePageGetInspector(InjectedBundle::shared().page()->page()), enabled);
+#endif // ENABLE(INSPECTOR)
 }
 
 typedef WTF::HashMap<unsigned, WKRetainPtr<WKBundleScriptWorldRef> > WorldMap;
index abea8e4..1afe3b3 100644 (file)
@@ -163,8 +163,10 @@ void TestInvocation::invoke()
         return;
     }
 
+#if ENABLE(INSPECTOR)
     if (shouldOpenWebInspector(m_pathOrURL.c_str()))
         WKInspectorShow(WKPageGetInspector(TestController::shared().mainWebView()->page()));
+#endif // ENABLE(INSPECTOR)        
 
     WKPageLoadURL(TestController::shared().mainWebView()->page(), m_url.get());
 
@@ -174,7 +176,9 @@ void TestInvocation::invoke()
     else if (m_error)
         dump("FAIL\n");
 
+#if ENABLE(INSPECTOR)
     WKInspectorClose(WKPageGetInspector(TestController::shared().mainWebView()->page()));
+#endif // ENABLE(INSPECTOR)
 }
 
 void TestInvocation::dump(const char* stringToDump, bool singleEOF)