Title: [137531] trunk/Source
Revision
137531
Author
commit-qu...@webkit.org
Date
2012-12-12 16:05:51 -0800 (Wed, 12 Dec 2012)

Log Message

[EFL] Refactor duplicate code into EflInspectorUtilities
https://bugs.webkit.org/show_bug.cgi?id=104329

Patch by Seokju Kwon <seokju.k...@gmail.com> on 2012-12-12
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Move duplicate work into EflInspectorUtilities.

No new tests, refactoring.

* PlatformEfl.cmake:
* platform/efl/EflInspectorUtilities.cpp: Added.
(WebCore):
(WebCore::inspectorResourcePath):
* platform/efl/EflInspectorUtilities.h: Added.
(WebCore):

Source/WebKit/efl:

Remove duplicated work to get the resource path for inspector.
And use WebCore::inspectorResourcePath().

* WebCoreSupport/InspectorClientEfl.cpp:
(WebCore::InspectorClientEfl::inspectorFilesPath):

Source/WebKit2:

Remove duplicated work to get the resource path for inspector.
And use WebCore::inspectorResourcePath().

* UIProcess/InspectorServer/efl/WebInspectorServerEfl.cpp:
(WebKit::WebInspectorServer::platformResourceForPath):
* UIProcess/efl/WebInspectorProxyEfl.cpp:
(WebKit::WebInspectorProxy::inspectorBaseURL):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (137530 => 137531)


--- trunk/Source/WebCore/ChangeLog	2012-12-12 23:56:59 UTC (rev 137530)
+++ trunk/Source/WebCore/ChangeLog	2012-12-13 00:05:51 UTC (rev 137531)
@@ -1,3 +1,21 @@
+2012-12-12  Seokju Kwon  <seokju.k...@gmail.com>
+
+        [EFL] Refactor duplicate code into EflInspectorUtilities
+        https://bugs.webkit.org/show_bug.cgi?id=104329
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Move duplicate work into EflInspectorUtilities.
+
+        No new tests, refactoring.
+
+        * PlatformEfl.cmake:
+        * platform/efl/EflInspectorUtilities.cpp: Added.
+        (WebCore):
+        (WebCore::inspectorResourcePath):
+        * platform/efl/EflInspectorUtilities.h: Added.
+        (WebCore):
+
 2012-12-12  Mark Lam  <mark....@apple.com>
 
         Fixing a chromium build breakage due to r137520.

Modified: trunk/Source/WebCore/PlatformEfl.cmake (137530 => 137531)


--- trunk/Source/WebCore/PlatformEfl.cmake	2012-12-12 23:56:59 UTC (rev 137530)
+++ trunk/Source/WebCore/PlatformEfl.cmake	2012-12-13 00:05:51 UTC (rev 137531)
@@ -28,6 +28,7 @@
     platform/efl/CursorEfl.cpp
     platform/efl/DragDataEfl.cpp
     platform/efl/DragImageEfl.cpp
+    platform/efl/EflInspectorUtilities.cpp
     platform/efl/EflKeyboardUtilities.cpp
     platform/efl/EflScreenUtilities.cpp
     platform/efl/ErrorsEfl.cpp

Added: trunk/Source/WebCore/platform/efl/EflInspectorUtilities.cpp (0 => 137531)


--- trunk/Source/WebCore/platform/efl/EflInspectorUtilities.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/efl/EflInspectorUtilities.cpp	2012-12-13 00:05:51 UTC (rev 137531)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2012 Seokju Kwon (seokju.k...@gmail.com)
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+
+#if ENABLE(INSPECTOR)
+#include "EflInspectorUtilities.h"
+
+#include <unistd.h>
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+String inspectorResourcePath()
+{
+    String inspectorResourcePath = String::fromUTF8(WEB_INSPECTOR_INSTALL_DIR);
+    if (access(inspectorResourcePath.utf8().data(), R_OK))
+        inspectorResourcePath = WEB_INSPECTOR_DIR;
+
+    return inspectorResourcePath;
+}
+
+} // namespace WebCore
+
+#endif

Added: trunk/Source/WebCore/platform/efl/EflInspectorUtilities.h (0 => 137531)


--- trunk/Source/WebCore/platform/efl/EflInspectorUtilities.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/efl/EflInspectorUtilities.h	2012-12-13 00:05:51 UTC (rev 137531)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2012 Seokju Kwon (seokju.k...@gmail.com)
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef EflInspectorUtilities_h
+#define EflInspectorUtilities_h
+
+#if ENABLE(INSPECTOR)
+
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+String inspectorResourcePath();
+
+} // namespace WebCore
+
+#endif
+#endif // EflInspectorUtilities_h

Modified: trunk/Source/WebKit/efl/ChangeLog (137530 => 137531)


--- trunk/Source/WebKit/efl/ChangeLog	2012-12-12 23:56:59 UTC (rev 137530)
+++ trunk/Source/WebKit/efl/ChangeLog	2012-12-13 00:05:51 UTC (rev 137531)
@@ -1,3 +1,16 @@
+2012-12-12  Seokju Kwon  <seokju.k...@gmail.com>
+
+        [EFL] Refactor duplicate code into EflInspectorUtilities
+        https://bugs.webkit.org/show_bug.cgi?id=104329
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Remove duplicated work to get the resource path for inspector.
+        And use WebCore::inspectorResourcePath().
+
+        * WebCoreSupport/InspectorClientEfl.cpp:
+        (WebCore::InspectorClientEfl::inspectorFilesPath):
+
 2012-12-12  Mark Lam  <mark....@apple.com>
 
         Encapsulate externally used webdatabase APIs in DatabaseManager.

Modified: trunk/Source/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp (137530 => 137531)


--- trunk/Source/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp	2012-12-12 23:56:59 UTC (rev 137530)
+++ trunk/Source/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp	2012-12-13 00:05:51 UTC (rev 137531)
@@ -22,10 +22,10 @@
 #include "InspectorClientEfl.h"
 
 #if ENABLE(INSPECTOR)
+#include "EflInspectorUtilities.h"
 #include "InspectorController.h"
 #include "NotImplemented.h"
 #include "ewk_view_private.h"
-#include <unistd.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -140,11 +140,7 @@
 
 String InspectorClientEfl::inspectorFilesPath()
 {
-    String inspectorFilesPath = WEB_INSPECTOR_INSTALL_DIR;
-    if (access(inspectorFilesPath.utf8().data(), R_OK))
-        inspectorFilesPath = WEB_INSPECTOR_DIR;
-
-    return "file://" + inspectorFilesPath;
+    return "file://" + inspectorResourcePath();
 }
 
 InspectorFrontendClientEfl::InspectorFrontendClientEfl(Evas_Object* inspectedView, Evas_Object* inspectorView, InspectorClientEfl* inspectorClient)

Modified: trunk/Source/WebKit2/ChangeLog (137530 => 137531)


--- trunk/Source/WebKit2/ChangeLog	2012-12-12 23:56:59 UTC (rev 137530)
+++ trunk/Source/WebKit2/ChangeLog	2012-12-13 00:05:51 UTC (rev 137531)
@@ -1,3 +1,18 @@
+2012-12-12  Seokju Kwon  <seokju.k...@gmail.com>
+
+        [EFL] Refactor duplicate code into EflInspectorUtilities
+        https://bugs.webkit.org/show_bug.cgi?id=104329
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Remove duplicated work to get the resource path for inspector.
+        And use WebCore::inspectorResourcePath().
+
+        * UIProcess/InspectorServer/efl/WebInspectorServerEfl.cpp:
+        (WebKit::WebInspectorServer::platformResourceForPath):
+        * UIProcess/efl/WebInspectorProxyEfl.cpp:
+        (WebKit::WebInspectorProxy::inspectorBaseURL):
+
 2012-12-12  Mark Lam  <mark....@apple.com>
 
         Encapsulate externally used webdatabase APIs in DatabaseManager.

Modified: trunk/Source/WebKit2/UIProcess/InspectorServer/efl/WebInspectorServerEfl.cpp (137530 => 137531)


--- trunk/Source/WebKit2/UIProcess/InspectorServer/efl/WebInspectorServerEfl.cpp	2012-12-12 23:56:59 UTC (rev 137530)
+++ trunk/Source/WebKit2/UIProcess/InspectorServer/efl/WebInspectorServerEfl.cpp	2012-12-13 00:05:51 UTC (rev 137531)
@@ -27,20 +27,12 @@
 
 #include "WebInspectorProxy.h"
 #include "WebPageProxy.h"
+#include <WebCore/EflInspectorUtilities.h>
 #include <WebCore/MIMETypeRegistry.h>
 #include <sys/stat.h>
 
 namespace WebKit {
 
-static String inspectorResourcePath()
-{
-    String inspectorFilesPath = String::fromUTF8(WEB_INSPECTOR_INSTALL_DIR);
-    if (access(inspectorFilesPath.utf8().data(), R_OK))
-        inspectorFilesPath = String::fromUTF8(WEB_INSPECTOR_DIR);
-
-    return inspectorFilesPath;
-}
-
 bool WebInspectorServer::platformResourceForPath(const String& path, Vector<char>& data, String& contentType)
 {
     // The page list contains an unformated list of pages that can be inspected with a link to open a session.
@@ -50,7 +42,7 @@
     }
 
     // Point the default path to a formatted page that queries the page list and display them.
-    String localPath = inspectorResourcePath() + ((path == "/") ? ASCIILiteral("/inspectorPageIndex.html") : path);
+    String localPath = WebCore::inspectorResourcePath() + ((path == "/") ? ASCIILiteral("/inspectorPageIndex.html") : path);
 
     FILE* fileHandle = fopen(localPath.utf8().data(), "r");
     if (!fileHandle)

Modified: trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp (137530 => 137531)


--- trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp	2012-12-12 23:56:59 UTC (rev 137530)
+++ trunk/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp	2012-12-13 00:05:51 UTC (rev 137531)
@@ -33,8 +33,8 @@
 #include "ewk_settings.h"
 #include "ewk_view.h"
 #include "ewk_view_private.h"
+#include <WebCore/EflInspectorUtilities.h>
 #include <WebCore/NotImplemented.h>
-#include <unistd.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/StringBuilder.h>
 #include <wtf/text/WTFString.h>
@@ -162,11 +162,7 @@
 
 String WebInspectorProxy::inspectorBaseURL() const
 {
-    String inspectorFilesPath = WEB_INSPECTOR_INSTALL_DIR;
-    if (access(inspectorFilesPath.utf8().data(), R_OK))
-        inspectorFilesPath = WEB_INSPECTOR_DIR;
-
-    return "file://" + inspectorFilesPath;
+    return "file://" + WebCore::inspectorResourcePath();
 }
 
 unsigned WebInspectorProxy::platformInspectedWindowHeight()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to