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

Side by Side Diff: trunk/src/chrome/browser/extensions/api/messaging/extension_message_port.h

Issue 16336011: Revert 203489 "Replace JSON (de)serialization of extension messa..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | trunk/src/chrome/browser/extensions/api/messaging/extension_message_port.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_
7 7
8 #include "chrome/browser/extensions/api/messaging/message_service.h" 8 #include "chrome/browser/extensions/api/messaging/message_service.h"
9 9
10 class GURL; 10 class GURL;
11 11
12 namespace base {
13 class ListValue;
14 }
15
16 namespace content { 12 namespace content {
17 class RenderProcessHost; 13 class RenderProcessHost;
18 } // namespace content 14 } // namespace content
19 15
20 namespace extensions { 16 namespace extensions {
21 17
22 // A port that manages communication with an extension. 18 // A port that manages communication with an extension.
23 class ExtensionMessagePort : public MessageService::MessagePort { 19 class ExtensionMessagePort : public MessageService::MessagePort {
24 public: 20 public:
25 ExtensionMessagePort(content::RenderProcessHost* process, 21 ExtensionMessagePort(content::RenderProcessHost* process,
26 int routing_id, 22 int routing_id,
27 const std::string& extension_id); 23 const std::string& extension_id);
28 virtual void DispatchOnConnect( 24 virtual void DispatchOnConnect(
29 int dest_port_id, 25 int dest_port_id,
30 const std::string& channel_name, 26 const std::string& channel_name,
31 const base::DictionaryValue& source_tab, 27 const base::DictionaryValue& source_tab,
32 const std::string& source_extension_id, 28 const std::string& source_extension_id,
33 const std::string& target_extension_id, 29 const std::string& target_extension_id,
34 const GURL& source_url) OVERRIDE; 30 const GURL& source_url) OVERRIDE;
35 virtual void DispatchOnDisconnect(int source_port_id, 31 virtual void DispatchOnDisconnect(int source_port_id,
36 const std::string& error_message) OVERRIDE; 32 const std::string& error_message) OVERRIDE;
37 virtual void DispatchOnMessage(scoped_ptr<base::ListValue> message, 33 virtual void DispatchOnMessage(const std::string& message,
38 int target_port_id) OVERRIDE; 34 int target_port_id) OVERRIDE;
39 virtual void IncrementLazyKeepaliveCount() OVERRIDE; 35 virtual void IncrementLazyKeepaliveCount() OVERRIDE;
40 virtual void DecrementLazyKeepaliveCount() OVERRIDE; 36 virtual void DecrementLazyKeepaliveCount() OVERRIDE;
41 virtual content::RenderProcessHost* GetRenderProcessHost() OVERRIDE; 37 virtual content::RenderProcessHost* GetRenderProcessHost() OVERRIDE;
42 38
43 private: 39 private:
44 content::RenderProcessHost* process_; 40 content::RenderProcessHost* process_;
45 int routing_id_; 41 int routing_id_;
46 std::string extension_id_; 42 std::string extension_id_;
47 void* background_host_ptr_; // used in IncrementLazyKeepaliveCount 43 void* background_host_ptr_; // used in IncrementLazyKeepaliveCount
48 }; 44 };
49 45
50 } // namespace extensions 46 } // namespace extensions
51 47
52 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_ 48 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_EXTENSION_MESSAGE_PORT_H_
OLDNEW
« no previous file with comments | « no previous file | trunk/src/chrome/browser/extensions/api/messaging/extension_message_port.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698