Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1090)

Unified Diff: third_party/WebKit/public/platform/WebMessagePortChannel.h

Issue 2422793002: HTML MessagePort as mojo::MessagePipeHandle (Closed)
Patch Set: Add missing ScopedAsyncTaskScheduler instance for the new unit tests; required by a recent change t… Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/public/platform/WebMessagePortChannel.h
diff --git a/third_party/WebKit/public/platform/WebMessagePortChannel.h b/third_party/WebKit/public/platform/WebMessagePortChannel.h
index 0739fbf0a02b8d2b8a74d9b443aa03891c6e0795..857155329e1651580016fffe2c1d6247d3a79412 100644
--- a/third_party/WebKit/public/platform/WebMessagePortChannel.h
+++ b/third_party/WebKit/public/platform/WebMessagePortChannel.h
@@ -33,48 +33,28 @@
#include "WebCommon.h"
#include "WebVector.h"
-
-#if INSIDE_BLINK
#include <memory>
-#endif
namespace blink {
class WebMessagePortChannelClient;
class WebString;
-typedef WebVector<class WebMessagePortChannel*> WebMessagePortChannelArray;
+using WebMessagePortChannelUniquePtr =
+ std::unique_ptr<class WebMessagePortChannel>;
+using WebMessagePortChannelArray = WebVector<WebMessagePortChannelUniquePtr>;
-// 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.
+// Provides an interface to a Message Port Channel implementation.
class WebMessagePortChannel {
public:
+ virtual ~WebMessagePortChannel() {}
virtual void setClient(WebMessagePortChannelClient*) = 0;
- virtual void destroy() = 0;
// Callee receives ownership of the passed vector.
// FIXME: Blob refs should be passed to maintain ref counts. crbug.com/351753
- virtual void postMessage(const WebString&, WebMessagePortChannelArray*) = 0;
+ virtual void postMessage(const WebString&, WebMessagePortChannelArray) = 0;
virtual bool tryGetMessage(WebString*, WebMessagePortChannelArray&) = 0;
-
- protected:
- ~WebMessagePortChannel() {}
};
-#if INSIDE_BLINK
-
-struct WebMessagePortChannelDeleter {
- void operator()(WebMessagePortChannel* channel) {
- if (channel)
- channel->destroy();
- }
-};
-
-using WebMessagePortChannelUniquePtr =
- std::unique_ptr<WebMessagePortChannel, WebMessagePortChannelDeleter>;
-
-#endif // INSIDE_BLINK
-
} // namespace blink
#endif // WebMessagePortChannel_h

Powered by Google App Engine
This is Rietveld 408576698