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

Side by Side Diff: content/public/browser/message_port_delegate.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_MESSAGE_PORT_DELEGATE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_DELEGATE_H_
6 #define CONTENT_BROWSER_MESSAGE_PORT_DELEGATE_H_ 6 #define CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_DELEGATE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 #include "content/common/content_export.h"
11 12
12 namespace content { 13 namespace content {
13 14
14 // Delegate used by MessagePortService to send messages to message ports to the 15 // Delegate used by MessagePortService to send messages to message ports to the
15 // correct renderer. Delegates are responsible for managing their own lifetime, 16 // correct renderer. Delegates are responsible for managing their own lifetime,
16 // and should call MessagePortService::OnMessagePortDelegateClosing if they are 17 // and should call MessagePortService::OnMessagePortDelegateClosing if they are
17 // destroyed while there are still message ports associated with them. 18 // destroyed while there are still message ports associated with them.
18 class MessagePortDelegate { 19 class CONTENT_EXPORT MessagePortDelegate {
19 public: 20 public:
20 // Sends a message to the given route. Implementations are responsible for 21 // Sends a message to the given route. Implementations are responsible for
21 // updating MessagePortService with new routes for the sent message ports. 22 // updating MessagePortService with new routes for the sent message ports.
22 virtual void SendMessage(int route_id, 23 virtual void SendMessage(int route_id,
23 const base::string16& message, 24 const base::string16& message,
24 const std::vector<int>& sent_message_port_ids) = 0; 25 const std::vector<int>& sent_message_port_ids) = 0;
25 26
26 // Sends a "messages are queued" IPC to the given route. 27 // Requests messages to the given route to be queued.
27 virtual void SendMessagesAreQueued(int route_id) = 0; 28 virtual void SendMessagesAreQueued(int route_id) = 0;
28 29
29 protected: 30 protected:
30 virtual ~MessagePortDelegate() {} 31 virtual ~MessagePortDelegate() {}
31 }; 32 };
32 33
33 } // namespace content 34 } // namespace content
34 35
35 #endif // CONTENT_BROWSER_MESSAGE_PORT_DELEGATE_H_ 36 #endif // CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698