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

Unified Diff: chrome/browser/extensions/api/messaging/message_service.h

Issue 16226004: Replace JSON (de)serialization of extension messages with direct Value pickling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/messaging/message_service.h
diff --git a/chrome/browser/extensions/api/messaging/message_service.h b/chrome/browser/extensions/api/messaging/message_service.h
index 69c23ef776cbebe7f980445712ca0ec7e691674c..df760f3376f64fc26733cd9d1e8d816c165a8e5a 100644
--- a/chrome/browser/extensions/api/messaging/message_service.h
+++ b/chrome/browser/extensions/api/messaging/message_service.h
@@ -22,6 +22,7 @@ class Profile;
namespace base {
class DictionaryValue;
+class ListValue;
}
namespace content {
@@ -82,7 +83,7 @@ class MessageService : public ProfileKeyedAPI,
const std::string& error_message) {}
// Dispatch a message to this end of the communication.
- virtual void DispatchOnMessage(const std::string& message,
+ virtual void DispatchOnMessage(scoped_ptr<base::ListValue> message,
int target_port_id) = 0;
// MessagPorts that target extensions will need to adjust their keepalive
@@ -144,12 +145,12 @@ class MessageService : public ProfileKeyedAPI,
const std::string& error_message) OVERRIDE;
// Sends a message to the given port.
- void PostMessage(int port_id, const std::string& message);
+ void PostMessage(int port_id, scoped_ptr<base::ListValue> message);
// NativeMessageProcessHost::Client
virtual void PostMessageFromNativeProcess(
int port_id,
- const std::string& message) OVERRIDE;
+ scoped_ptr<base::ListValue> message) OVERRIDE;
private:
friend class MockMessageService;
@@ -205,10 +206,10 @@ class MessageService : public ProfileKeyedAPI,
CloseChannel(port_id, error_message);
}
void PendingPostMessage(int port_id,
- const std::string& message,
+ scoped_ptr<base::ListValue> message,
extensions::ExtensionHost* host) {
if (host)
- PostMessage(port_id, message);
+ PostMessage(port_id, message.Pass());
}
// ProfileKeyedAPI implementation.

Powered by Google App Engine
This is Rietveld 408576698