Title: [119666] trunk/Source
Revision
119666
Author
[email protected]
Date
2012-06-06 19:40:39 -0700 (Wed, 06 Jun 2012)

Log Message

[Chromium] Move createMessagePortChannel to Platform.h
https://bugs.webkit.org/show_bug.cgi?id=85764

Source/Platform:

Reviewed by Adam Barth.

Part of a refactoring series. See tracking bug 82948.

* Platform.gypi:
* chromium/public/Platform.h:
(WebKit):
(Platform):
(WebKit::Platform::createMessagePortChannel):
* chromium/public/WebMessagePortChannel.h: Added.
(WebKit):
(WebMessagePortChannel):
(WebKit::WebMessagePortChannel::~WebMessagePortChannel):
* chromium/public/WebMessagePortChannelClient.h: Added.
(WebKit):
(WebMessagePortChannelClient):
(WebKit::WebMessagePortChannelClient::~WebMessagePortChannelClient):

Source/WebKit/chromium:

Reviewed by Adam Barth.

Part of a refactoring series. See tracking bug 82948.

* WebKit.gyp:
* public/WebFrame.h:
(WebFrame):
* public/WebMessagePortChannel.h:
* public/WebMessagePortChannelClient.h:
* public/WebSharedWorkerClient.h:
(WebSharedWorkerClient):
* public/platform/WebKitPlatformSupport.h:
(WebKit):
(WebKit::WebKitPlatformSupport::injectIDBKeyIntoSerializedValue):
* src/PlatformMessagePortChannel.cpp:
(WebCore::PlatformMessagePortChannel::PlatformMessagePortChannel):
* src/PlatformMessagePortChannel.h:
* src/SharedWorkerRepository.cpp:
* src/WebSharedWorkerImpl.cpp:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (119665 => 119666)


--- trunk/Source/Platform/ChangeLog	2012-06-07 02:39:59 UTC (rev 119665)
+++ trunk/Source/Platform/ChangeLog	2012-06-07 02:40:39 UTC (rev 119666)
@@ -1,3 +1,26 @@
+2012-06-06  Mark Pilgrim  <[email protected]>
+
+        [Chromium] Move createMessagePortChannel to Platform.h
+        https://bugs.webkit.org/show_bug.cgi?id=85764
+
+        Reviewed by Adam Barth.
+
+        Part of a refactoring series. See tracking bug 82948.
+
+        * Platform.gypi:
+        * chromium/public/Platform.h:
+        (WebKit):
+        (Platform):
+        (WebKit::Platform::createMessagePortChannel):
+        * chromium/public/WebMessagePortChannel.h: Added.
+        (WebKit):
+        (WebMessagePortChannel):
+        (WebKit::WebMessagePortChannel::~WebMessagePortChannel):
+        * chromium/public/WebMessagePortChannelClient.h: Added.
+        (WebKit):
+        (WebMessagePortChannelClient):
+        (WebKit::WebMessagePortChannelClient::~WebMessagePortChannelClient):
+
 2012-06-05  Mark Pilgrim  <[email protected]>
 
         [Chromium] Move createLocalStorageNamespace to Platform.h

Modified: trunk/Source/Platform/Platform.gypi (119665 => 119666)


--- trunk/Source/Platform/Platform.gypi	2012-06-07 02:39:59 UTC (rev 119665)
+++ trunk/Source/Platform/Platform.gypi	2012-06-07 02:40:39 UTC (rev 119666)
@@ -77,6 +77,8 @@
             'chromium/public/WebMediaStreamDescriptor.h',
             'chromium/public/WebMediaStreamSource.h',
             'chromium/public/WebMediaStreamSourcesRequest.h',
+            'chromium/public/WebMessagePortChannel.h',
+            'chromium/public/WebMessagePortChannelClient.h',
             'chromium/public/WebMimeRegistry.h',
             'chromium/public/WebNonCopyable.h',
             'chromium/public/WebPeerConnection00Handler.h',

Modified: trunk/Source/Platform/chromium/public/Platform.h (119665 => 119666)


--- trunk/Source/Platform/chromium/public/Platform.h	2012-06-07 02:39:59 UTC (rev 119665)
+++ trunk/Source/Platform/chromium/public/Platform.h	2012-06-07 02:40:39 UTC (rev 119666)
@@ -49,6 +49,7 @@
 class WebFileUtilities;
 class WebMediaStreamCenter;
 class WebMediaStreamCenterClient;
+class WebMessagePortChannel;
 class WebMimeRegistry;
 class WebPeerConnection00Handler;
 class WebPeerConnection00HandlerClient;
@@ -165,6 +166,14 @@
     // false on platform specific error conditions.
     virtual bool processMemorySizesInBytes(size_t* privateBytes, size_t* sharedBytes) { return false; }
 
+
+    // Message Ports -------------------------------------------------------
+
+    // Creates a Message Port Channel. This can be called on any thread.
+    // The returned object should only be used on the thread it was created on.
+    virtual WebMessagePortChannel* createMessagePortChannel() { return 0; }
+
+
     // Network -------------------------------------------------------------
 
     // Returns a new WebURLLoader instance.

Copied: trunk/Source/Platform/chromium/public/WebMessagePortChannel.h (from rev 119664, trunk/Source/WebKit/chromium/public/WebMessagePortChannel.h) (0 => 119666)


--- trunk/Source/Platform/chromium/public/WebMessagePortChannel.h	                        (rev 0)
+++ trunk/Source/Platform/chromium/public/WebMessagePortChannel.h	2012-06-07 02:40:39 UTC (rev 119666)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebMessagePortChannel_h
+#define WebMessagePortChannel_h
+
+#include "WebCommon.h"
+#include "WebVector.h"
+
+namespace WebKit {
+
+class WebMessagePortChannelClient;
+class WebString;
+
+typedef WebVector<class WebMessagePortChannel*> WebMessagePortChannelArray;
+
+// Provides an interface to a Message Port Channel implementation. The object owns itself and
+// is signalled that its not needed anymore with the destroy() call.
+class WebMessagePortChannel {
+public:
+    virtual void setClient(WebMessagePortChannelClient*) = 0;
+    virtual void destroy() = 0;
+    // WebKit versions of WebCore::MessagePortChannel.
+    virtual void entangle(WebMessagePortChannel*) = 0;
+    // Callee receives ownership of the passed vector.
+    virtual void postMessage(const WebString&, WebMessagePortChannelArray*) = 0;
+    virtual bool tryGetMessage(WebString*, WebMessagePortChannelArray&) = 0;
+
+protected:
+    ~WebMessagePortChannel() { }
+};
+
+} // namespace WebKit
+
+#endif

Copied: trunk/Source/Platform/chromium/public/WebMessagePortChannelClient.h (from rev 119664, trunk/Source/WebKit/chromium/public/WebMessagePortChannelClient.h) (0 => 119666)


--- trunk/Source/Platform/chromium/public/WebMessagePortChannelClient.h	                        (rev 0)
+++ trunk/Source/Platform/chromium/public/WebMessagePortChannelClient.h	2012-06-07 02:40:39 UTC (rev 119666)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebMessagePortChannelClient_h
+#define WebMessagePortChannelClient_h
+
+namespace WebKit {
+
+// Provides an interface for users of WebMessagePortChannel to be notified
+// when messages are available.
+class WebMessagePortChannelClient {
+public:
+    // Alerts that new messages have arrived, which are retrieved by calling
+    // WebMessagePortChannel::tryGetMessage. Note that this may be called
+    // on any thread.
+    virtual void messageAvailable() = 0;
+
+protected:
+    ~WebMessagePortChannelClient() { }
+};
+
+} // namespace WebKit
+
+#endif

Modified: trunk/Source/WebKit/chromium/ChangeLog (119665 => 119666)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-06-07 02:39:59 UTC (rev 119665)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-06-07 02:40:39 UTC (rev 119666)
@@ -1,3 +1,28 @@
+2012-06-06  Mark Pilgrim  <[email protected]>
+
+        [Chromium] Move createMessagePortChannel to Platform.h
+        https://bugs.webkit.org/show_bug.cgi?id=85764
+
+        Reviewed by Adam Barth.
+        
+        Part of a refactoring series. See tracking bug 82948.
+
+        * WebKit.gyp:
+        * public/WebFrame.h:
+        (WebFrame):
+        * public/WebMessagePortChannel.h:
+        * public/WebMessagePortChannelClient.h:
+        * public/WebSharedWorkerClient.h:
+        (WebSharedWorkerClient):
+        * public/platform/WebKitPlatformSupport.h:
+        (WebKit):
+        (WebKit::WebKitPlatformSupport::injectIDBKeyIntoSerializedValue):
+        * src/PlatformMessagePortChannel.cpp:
+        (WebCore::PlatformMessagePortChannel::PlatformMessagePortChannel):
+        * src/PlatformMessagePortChannel.h:
+        * src/SharedWorkerRepository.cpp:
+        * src/WebSharedWorkerImpl.cpp:
+
 2012-06-06  Amy Ousterhout  <[email protected]>
 
         [Chromium] DeviceOrientation cleanup

Modified: trunk/Source/WebKit/chromium/WebKit.gyp (119665 => 119666)


--- trunk/Source/WebKit/chromium/WebKit.gyp	2012-06-07 02:39:59 UTC (rev 119665)
+++ trunk/Source/WebKit/chromium/WebKit.gyp	2012-06-07 02:40:39 UTC (rev 119666)
@@ -199,8 +199,6 @@
                 'public/WebMediaPlayerClient.h',
                 'public/WebMediaStreamRegistry.h',
                 'public/WebMenuItemInfo.h',
-                'public/WebMessagePortChannel.h',
-                'public/WebMessagePortChannelClient.h',
                 'public/WebNavigationType.h',
                 'public/WebNetworkStateNotifier.h',
                 'public/WebNode.h',

Modified: trunk/Source/WebKit/chromium/public/WebFrame.h (119665 => 119666)


--- trunk/Source/WebKit/chromium/public/WebFrame.h	2012-06-07 02:39:59 UTC (rev 119665)
+++ trunk/Source/WebKit/chromium/public/WebFrame.h	2012-06-07 02:40:39 UTC (rev 119666)
@@ -163,7 +163,7 @@
     // The minimum and maxium scroll positions in pixels.
     virtual WebSize minimumScrollOffset() const = 0;
     virtual WebSize maximumScrollOffset() const = 0;
- 
+
     // The size of the contents area.
     virtual WebSize contentsSize() const = 0;
 
@@ -640,7 +640,7 @@
     // empty ((0,0), (0,0)).
     virtual WebRect selectionBoundsRect() const = 0;
 
-    // Only for testing purpose: 
+    // Only for testing purpose:
     // Returns true if selection.anchorNode has a marker on range from |from| with |length|.
     virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const = 0;
 

Modified: trunk/Source/WebKit/chromium/public/WebMessagePortChannel.h (119665 => 119666)


--- trunk/Source/WebKit/chromium/public/WebMessagePortChannel.h	2012-06-07 02:39:59 UTC (rev 119665)
+++ trunk/Source/WebKit/chromium/public/WebMessagePortChannel.h	2012-06-07 02:40:39 UTC (rev 119666)
@@ -28,35 +28,4 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebMessagePortChannel_h
-#define WebMessagePortChannel_h
-
-#include "platform/WebCommon.h"
-#include "platform/WebVector.h"
-
-namespace WebKit {
-
-class WebMessagePortChannelClient;
-class WebString;
-
-typedef WebVector<class WebMessagePortChannel*> WebMessagePortChannelArray;
-
-// Provides an interface to a Message Port Channel implementation.  The object owns itself and
-// is signalled that its not needed anymore with the destroy() call.
-class WebMessagePortChannel {
-public:
-    virtual void setClient(WebMessagePortChannelClient*) = 0;
-    virtual void destroy() = 0;
-    // WebKit versions of WebCore::MessagePortChannel.
-    virtual void entangle(WebMessagePortChannel*) = 0;
-    // Callee receives ownership of the passed vector.
-    virtual void postMessage(const WebString&, WebMessagePortChannelArray*) = 0;
-    virtual bool tryGetMessage(WebString*, WebMessagePortChannelArray&) = 0;
-
-protected:
-    ~WebMessagePortChannel() { }
-};
-
-} // namespace WebKit
-
-#endif
+#include "../../../Platform/chromium/public/WebMessagePortChannel.h"

Modified: trunk/Source/WebKit/chromium/public/WebMessagePortChannelClient.h (119665 => 119666)


--- trunk/Source/WebKit/chromium/public/WebMessagePortChannelClient.h	2012-06-07 02:39:59 UTC (rev 119665)
+++ trunk/Source/WebKit/chromium/public/WebMessagePortChannelClient.h	2012-06-07 02:40:39 UTC (rev 119666)
@@ -28,24 +28,4 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebMessagePortChannelClient_h
-#define WebMessagePortChannelClient_h
-
-namespace WebKit {
-
-// Provides an interface for users of WebMessagePortChannel to be notified
-// when messages are available.
-class WebMessagePortChannelClient {
-public:
-    // Alerts that new messages have arrived, which are retrieved by calling
-    // WebMessagePortChannel::tryGetMessage.  Note that this may be called
-    // on any thread.
-    virtual void messageAvailable() = 0;
-
-protected:
-    ~WebMessagePortChannelClient() { }
-};
-
-} // namespace WebKit
-
-#endif
+#include "../../../Platform/chromium/public/WebMessagePortChannelClient.h"

Modified: trunk/Source/WebKit/chromium/public/WebSharedWorkerClient.h (119665 => 119666)


--- trunk/Source/WebKit/chromium/public/WebSharedWorkerClient.h	2012-06-07 02:39:59 UTC (rev 119665)
+++ trunk/Source/WebKit/chromium/public/WebSharedWorkerClient.h	2012-06-07 02:40:39 UTC (rev 119666)
@@ -56,7 +56,7 @@
         const WebString& errorString, int lineNumber,
         const WebString& sourceURL) = 0;
 
-    // FIXME: the below is for compatibility only and should be   
+    // FIXME: the below is for compatibility only and should be
     // removed once Chromium is updated to remove message
     // destination parameter <http://webkit.org/b/37155>.
     virtual void postConsoleMessageToWorkerObject(int, int sourceIdentifier, int messageType, int messageLevel,

Modified: trunk/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h (119665 => 119666)


--- trunk/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h	2012-06-07 02:39:59 UTC (rev 119665)
+++ trunk/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h	2012-06-07 02:40:39 UTC (rev 119666)
@@ -51,7 +51,6 @@
 class WebIDBFactory; // FIXME: Does this belong in platform?
 class WebIDBKey; // FIXME: Does this belong in platform?
 class WebIDBKeyPath; // FIXME: Does this belong in platform?
-class WebMessagePortChannel; // FIXME: Does this belong in platform?
 class WebPluginListBuilder; // FIXME: Does this belong in platform?
 class WebSharedWorkerRepository; // FIXME: Does this belong in platform?
 
@@ -90,13 +89,6 @@
     virtual WebSerializedScriptValue injectIDBKeyIntoSerializedValue(const WebIDBKey& key, const WebSerializedScriptValue& value, const WebIDBKeyPath& keyPath) { return WebSerializedScriptValue(); }
 
 
-    // Message Ports -------------------------------------------------------
-
-    // Creates a Message Port Channel. This can be called on any thread.
-    // The returned object should only be used on the thread it was created on.
-    virtual WebMessagePortChannel* createMessagePortChannel() { return 0; }
-
-
     // Plugins -------------------------------------------------------------
 
     // If refresh is true, then cached information should not be used to

Modified: trunk/Source/WebKit/chromium/src/PlatformMessagePortChannel.cpp (119665 => 119666)


--- trunk/Source/WebKit/chromium/src/PlatformMessagePortChannel.cpp	2012-06-07 02:39:59 UTC (rev 119665)
+++ trunk/Source/WebKit/chromium/src/PlatformMessagePortChannel.cpp	2012-06-07 02:40:39 UTC (rev 119666)
@@ -36,10 +36,11 @@
 #include "SerializedScriptValue.h"
 
 #include "WebKit.h"
-#include "platform/WebKitPlatformSupport.h"
-#include "WebMessagePortChannel.h"
-#include "platform/WebString.h"
 
+#include <public/Platform.h>
+#include <public/WebMessagePortChannel.h>
+#include <public/WebString.h>
+
 using namespace WebKit;
 
 namespace WebCore {
@@ -122,7 +123,7 @@
 PlatformMessagePortChannel::PlatformMessagePortChannel()
     : m_localPort(0)
 {
-    m_webChannel = webKitPlatformSupport()->createMessagePortChannel();
+    m_webChannel = WebKit::Platform::current()->createMessagePortChannel();
     if (m_webChannel)
         m_webChannel->setClient(this);
 }

Modified: trunk/Source/WebKit/chromium/src/PlatformMessagePortChannel.h (119665 => 119666)


--- trunk/Source/WebKit/chromium/src/PlatformMessagePortChannel.h	2012-06-07 02:39:59 UTC (rev 119665)
+++ trunk/Source/WebKit/chromium/src/PlatformMessagePortChannel.h	2012-06-07 02:40:39 UTC (rev 119666)
@@ -31,9 +31,9 @@
 #ifndef PlatformMessagePortChannel_h
 #define PlatformMessagePortChannel_h
 
-#include "WebMessagePortChannelClient.h"
 
 #include "MessagePortChannel.h"
+#include <public/WebMessagePortChannelClient.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/Threading.h>
 

Modified: trunk/Source/WebKit/chromium/src/SharedWorkerRepository.cpp (119665 => 119666)


--- trunk/Source/WebKit/chromium/src/SharedWorkerRepository.cpp	2012-06-07 02:39:59 UTC (rev 119665)
+++ trunk/Source/WebKit/chromium/src/SharedWorkerRepository.cpp	2012-06-07 02:40:39 UTC (rev 119666)
@@ -47,15 +47,17 @@
 #include "WebFrameClient.h"
 #include "WebFrameImpl.h"
 #include "WebKit.h"
-#include "WebMessagePortChannel.h"
 #include "WebSharedWorker.h"
 #include "WebSharedWorkerRepository.h"
 #include "platform/WebKitPlatformSupport.h"
-#include "platform/WebString.h"
-#include "platform/WebURL.h"
 #include "WorkerScriptLoader.h"
 #include "WorkerScriptLoaderClient.h"
 
+#include <public/Platform.h>
+#include <public/WebMessagePortChannel.h>
+#include <public/WebString.h>
+#include <public/WebURL.h>
+
 namespace WebCore {
 
 class Document;

Modified: trunk/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp (119665 => 119666)


--- trunk/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp	2012-06-07 02:39:59 UTC (rev 119665)
+++ trunk/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp	2012-06-07 02:40:39 UTC (rev 119666)
@@ -46,7 +46,6 @@
 #include "WebFileError.h"
 #include "WebFrameClient.h"
 #include "WebFrameImpl.h"
-#include "WebMessagePortChannel.h"
 #include "WebRuntimeFeatures.h"
 #include "WebSettings.h"
 #include "WebSharedWorkerClient.h"
@@ -56,8 +55,9 @@
 #include "WorkerInspectorController.h"
 #include "WorkerLoaderProxy.h"
 #include "WorkerThread.h"
-#include "platform/WebString.h"
-#include "platform/WebURL.h"
+#include <public/WebMessagePortChannel.h>
+#include <public/WebString.h>
+#include <public/WebURL.h>
 #include <wtf/MainThread.h>
 
 using namespace WebCore;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to