[GTK] Remote Web Inspector sometimes won't serve any content
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 May 2013 12:45:59 +0000 (12:45 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 May 2013 12:45:59 +0000 (12:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=116225

Patch by Anton Obzhirov <a.obzhirov@samsung.com> on 2013-05-23
Reviewed by Gustavo Noronha Silva.

Added an option to use environment variable to set up path to
inspector server files. Implementation is similar to InspectorClientGtk
implementation.

* UIProcess/InspectorServer/WebInspectorServer.h:
(WebInspectorServer):
* UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:
(WebKit::WebInspectorServer::platformResourceForPath):
(WebKit::WebInspectorServer::inspectorServerFilesPath):
(WebKit):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/InspectorServer/WebInspectorServer.h
Source/WebKit2/UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp

index c31f4ab..d9408eb 100644 (file)
@@ -1,3 +1,21 @@
+2013-05-23  Anton Obzhirov  <a.obzhirov@samsung.com>
+
+        [GTK] Remote Web Inspector sometimes won't serve any content
+        https://bugs.webkit.org/show_bug.cgi?id=116225
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Added an option to use environment variable to set up path to
+        inspector server files. Implementation is similar to InspectorClientGtk
+        implementation.
+
+        * UIProcess/InspectorServer/WebInspectorServer.h:
+        (WebInspectorServer):
+        * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:
+        (WebKit::WebInspectorServer::platformResourceForPath):
+        (WebKit::WebInspectorServer::inspectorServerFilesPath):
+        (WebKit):
+
 2013-05-23  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
         [EFL][WK2] Use WK2 C API in ewk_view_pagination_mode_set|get
index c419f11..fc8ddf4 100644 (file)
@@ -67,6 +67,10 @@ private:
 
     void closeConnection(WebInspectorProxy*, WebSocketServerConnection*);
 
+#if PLATFORM(GTK)
+    String inspectorServerFilesPath();
+    String m_inspectorServerFilesPath;
+#endif
     unsigned m_nextAvailablePageId;
     ClientMap m_clientMap;
     HashMap<unsigned, WebSocketServerConnection*> m_connectionMap;
index 0f5ad2e..c31f820 100644 (file)
@@ -48,7 +48,7 @@ bool WebInspectorServer::platformResourceForPath(const String& path, Vector<char
     }
 
     // Point the default path to a formatted page that queries the page list and display them.
-    CString localPath = WebCore::fileSystemRepresentation(String(WebCore::sharedResourcesPath().data()) + ((path == "/") ? "/webinspector/inspectorPageIndex.html" : path));
+    CString localPath = WebCore::fileSystemRepresentation(inspectorServerFilesPath() + ((path == "/") ? "/webinspector/inspectorPageIndex.html" : path));
     if (localPath.isNull())
         return false;
 
@@ -95,5 +95,19 @@ void WebInspectorServer::buildPageList(Vector<char>& data, String& contentType)
     contentType = "application/json; charset=utf-8";
 }
 
+String WebInspectorServer::inspectorServerFilesPath()
+{
+    if (!m_inspectorServerFilesPath.isNull())
+        return m_inspectorServerFilesPath;
+
+    const char* environmentPath = g_getenv("WEBKIT_INSPECTOR_SERVER_PATH");
+    if (environmentPath && g_file_test(environmentPath, G_FILE_TEST_IS_DIR))
+        m_inspectorServerFilesPath = String(environmentPath);
+    else
+        m_inspectorServerFilesPath = String(WebCore::sharedResourcesPath().data());
+
+    return m_inspectorServerFilesPath;
+}
+
 }
 #endif