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

Side by Side Diff: content/public/browser/message_port_delegate.h

Issue 944443003: Step two of optionally sending messages to/from message ports as base::Value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-c-message-as-values-take2
Patch Set: use auto where it makes sense Created 5 years, 9 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
« no previous file with comments | « content/common/view_messages.h ('k') | content/public/browser/message_port_provider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_PUBLIC_BROWSER_MESSAGE_PORT_DELEGATE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_DELEGATE_H_
6 #define CONTENT_PUBLIC_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 #include "content/common/content_export.h"
12 12
13 // Windows headers will redefine SendMessage. 13 // Windows headers will redefine SendMessage.
14 #ifdef SendMessage 14 #ifdef SendMessage
15 #undef SendMessage 15 #undef SendMessage
16 #endif 16 #endif
17 17
18 namespace content { 18 namespace content {
19 struct MessagePortMessage; 19 struct MessagePortMessage;
20 struct TransferredMessagePort;
20 21
21 // Delegate used by MessagePortService to send messages to message ports to the 22 // Delegate used by MessagePortService to send messages to message ports to the
22 // correct renderer. Delegates are responsible for managing their own lifetime, 23 // correct renderer. Delegates are responsible for managing their own lifetime,
23 // and should call MessagePortService::OnMessagePortDelegateClosing if they are 24 // and should call MessagePortService::OnMessagePortDelegateClosing if they are
24 // destroyed while there are still message ports associated with them. 25 // destroyed while there are still message ports associated with them.
25 class CONTENT_EXPORT MessagePortDelegate { 26 class CONTENT_EXPORT MessagePortDelegate {
26 public: 27 public:
27 // Sends a message to the given route. Implementations are responsible for 28 // Sends a message to the given route. Implementations are responsible for
28 // updating MessagePortService with new routes for the sent message ports. 29 // updating MessagePortService with new routes for the sent message ports.
29 virtual void SendMessage(int route_id, 30 virtual void SendMessage(
30 const MessagePortMessage& message, 31 int route_id,
31 const std::vector<int>& sent_message_port_ids) = 0; 32 const MessagePortMessage& message,
33 const std::vector<TransferredMessagePort>& sent_message_ports) = 0;
32 34
33 // Requests messages to the given route to be queued. 35 // Requests messages to the given route to be queued.
34 virtual void SendMessagesAreQueued(int route_id) = 0; 36 virtual void SendMessagesAreQueued(int route_id) = 0;
35 37
36 protected: 38 protected:
37 virtual ~MessagePortDelegate() {} 39 virtual ~MessagePortDelegate() {}
38 }; 40 };
39 41
40 } // namespace content 42 } // namespace content
41 43
42 #endif // CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_DELEGATE_H_ 44 #endif // CONTENT_PUBLIC_BROWSER_MESSAGE_PORT_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/common/view_messages.h ('k') | content/public/browser/message_port_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698