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

Unified Diff: content/child/webmessageportchannel_impl.h

Issue 921013002: Optionally have MessagePort pass data as base::Value, part 1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-c-move-v8-value-converter
Patch Set: Created 5 years, 10 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: content/child/webmessageportchannel_impl.h
diff --git a/content/child/webmessageportchannel_impl.h b/content/child/webmessageportchannel_impl.h
index f3e6714431ef9f45ee9c5ebaa1accb681d84a57f..4edfa7a564f2830d6febb9700e1c0dbe36057f00 100644
--- a/content/child/webmessageportchannel_impl.h
+++ b/content/child/webmessageportchannel_impl.h
@@ -10,13 +10,16 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "base/synchronization/lock.h"
+#include "content/public/common/message_port_message.h"
#include "ipc/ipc_listener.h"
#include "third_party/WebKit/public/platform/WebMessagePortChannel.h"
namespace base {
class SingleThreadTaskRunner;
+class Value;
}
namespace content {
@@ -68,13 +71,13 @@ class WebMessagePortChannelImpl
void Init();
void Entangle(scoped_refptr<WebMessagePortChannelImpl> channel);
void Send(IPC::Message* message);
- void PostMessage(const base::string16& message,
+ void PostMessage(const MessagePortMessage& message,
blink::WebMessagePortChannelArray* channels);
// IPC::Listener implementation.
bool OnMessageReceived(const IPC::Message& message) override;
- void OnMessage(const base::string16& message,
+ void OnMessage(const MessagePortMessage& message,
const std::vector<int>& sent_message_port_ids,
const std::vector<int>& new_routing_ids);
void OnMessagesQueued();
@@ -83,7 +86,7 @@ class WebMessagePortChannelImpl
Message();
~Message();
- base::string16 message;
+ MessagePortMessage message;
std::vector<WebMessagePortChannelImpl*> ports;
};
@@ -95,6 +98,11 @@ class WebMessagePortChannelImpl
int route_id_; // The routing id for this object.
int message_port_id_; // A globally unique identifier for this message port.
+ // Flag to indicate if messages should be send to the browser process as
scheib 2015/02/18 20:58:55 s/send/sent/
Marijn Kruisselbrink 2015/02/26 23:12:54 Done.
+ // base::Value instances as opposed to being serialized using the default
+ // blink::WebSerializedScriptValue. Not currently ever set as there are some
scheib 2015/02/18 20:58:55 Cite an issue#
Marijn Kruisselbrink 2015/02/26 23:12:54 Actually I just removed this part of the comment,
+ // issues to work out with message ports that are transferred.
+ bool send_messages_as_values_;
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
DISALLOW_COPY_AND_ASSIGN(WebMessagePortChannelImpl);

Powered by Google App Engine
This is Rietveld 408576698