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

Side by Side Diff: trunk/src/chrome/browser/extensions/message_handler.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
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_MESSAGE_HANDLER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_MESSAGE_HANDLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_MESSAGE_HANDLER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_MESSAGE_HANDLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "content/public/browser/render_view_host_observer.h" 10 #include "content/public/browser/render_view_host_observer.h"
11 11
12 namespace base {
13 class ListValue;
14 }
15
16 namespace extensions { 12 namespace extensions {
17 13
18 // Filters and dispatches extension-related IPC messages that arrive from 14 // Filters and dispatches extension-related IPC messages that arrive from
19 // renderers. There is one of these objects for each RenderViewHost in Chrome. 15 // renderers. There is one of these objects for each RenderViewHost in Chrome.
20 // Contrast this with extensions::TabHelper, which is only created for 16 // Contrast this with extensions::TabHelper, which is only created for
21 // WebContents. 17 // WebContents.
22 // 18 //
23 // TODO(aa): Handling of content script messaging should be able to move to EFD 19 // TODO(aa): Handling of content script messaging should be able to move to EFD
24 // once there is an EFD for every RVHD where extension code can run. Then we 20 // once there is an EFD for every RVHD where extension code can run. Then we
25 // could eliminate this class. Right now, we don't end up with an EFD for tab 21 // could eliminate this class. Right now, we don't end up with an EFD for tab
26 // contents unless that tab contents is hosting chrome-extension:// URLs. That 22 // contents unless that tab contents is hosting chrome-extension:// URLs. That
27 // still leaves content scripts. See also: crbug.com/80307. 23 // still leaves content scripts. See also: crbug.com/80307.
28 class MessageHandler : public content::RenderViewHostObserver { 24 class MessageHandler : public content::RenderViewHostObserver {
29 public: 25 public:
30 // |sender| is guaranteed to outlive this object. 26 // |sender| is guaranteed to outlive this object.
31 explicit MessageHandler(content::RenderViewHost* render_view_host); 27 explicit MessageHandler(content::RenderViewHost* render_view_host);
32 virtual ~MessageHandler(); 28 virtual ~MessageHandler();
33 29
34 // RenderViewHostObserver overrides. 30 // RenderViewHostObserver overrides.
35 virtual void RenderViewHostInitialized() OVERRIDE; 31 virtual void RenderViewHostInitialized() OVERRIDE;
36 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 32 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
37 33
38 private: 34 private:
39 // Message handlers. 35 // Message handlers.
40 void OnPostMessage(int port_id, const base::ListValue& message); 36 void OnPostMessage(int port_id, const std::string& message);
41 37
42 DISALLOW_COPY_AND_ASSIGN(MessageHandler); 38 DISALLOW_COPY_AND_ASSIGN(MessageHandler);
43 }; 39 };
44 40
45 } // namespace extensions 41 } // namespace extensions
46 42
47 #endif // CHROME_BROWSER_EXTENSIONS_MESSAGE_HANDLER_H_ 43 #endif // CHROME_BROWSER_EXTENSIONS_MESSAGE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698