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

Unified Diff: content/public/browser/message_port_provider.h

Issue 831523004: Enable posting a message from JS to Android webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix component builds Created 5 years, 11 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: content/public/browser/message_port_provider.h
diff --git a/content/public/browser/message_port_provider.h b/content/public/browser/message_port_provider.h
index aab9269366a05f47fa0df911b63f47525ac980bd..70fbe1127030396ec203bdc7f537b4448e6b0020 100644
--- a/content/public/browser/message_port_provider.h
+++ b/content/public/browser/message_port_provider.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -14,6 +14,7 @@
namespace content {
+class MessagePortDelegate;
class WebContents;
// An interface consisting of methods that can be called to use Message ports.
@@ -24,7 +25,7 @@ class CONTENT_EXPORT MessagePortProvider {
// part of the message.
// See https://html.spec.whatwg.org/multipage/comms.html#messageevent for
// further information on message events.
- // Should be called on IO thread.
+ // Should be called on UI thread.
static void PostMessageToFrame(WebContents* web_contents,
const base::string16& source_origin,
const base::string16& target_origin,
@@ -35,10 +36,15 @@ class CONTENT_EXPORT MessagePortProvider {
// associated with this message channel.
// See https://html.spec.whatwg.org/multipage/comms.html#messagechannel
// Should be called on IO thread.
- static void CreateMessageChannel(WebContents* web_contents,
+ // The message ports that are created will have their routing id numbers equal
+ // to the message port numbers.
+ static void CreateMessageChannel(MessagePortDelegate* delegate,
int* port1,
int* port2);
+ // Cleanup the message ports that belong to the closing delegate.
+ static void OnMessagePortDelegateClosing(MessagePortDelegate * delegate);
+
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePortProvider);
};

Powered by Google App Engine
This is Rietveld 408576698