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

Unified Diff: webkit/glue/web_intent_data.cc

Issue 10268014: Add constructor to get extras, service, ports from WebIntent object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
« no previous file with comments | « webkit/glue/web_intent_data.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/web_intent_data.cc
diff --git a/webkit/glue/web_intent_data.cc b/webkit/glue/web_intent_data.cc
index af85b2f307e0364c557d8773eb54b8dc9f86ef99..4958a596de112628115c5646a3cf14e508dc680b 100644
--- a/webkit/glue/web_intent_data.cc
+++ b/webkit/glue/web_intent_data.cc
@@ -4,7 +4,11 @@
#include "webkit/glue/web_intent_data.h"
+#include "content/common/webmessageportchannel_impl.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIntent.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebMessagePortChannel.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
namespace webkit_glue {
@@ -20,8 +24,27 @@ WebIntentData::WebIntentData(const WebKit::WebIntent& intent)
: action(intent.action()),
type(intent.type()),
data(intent.data()),
+ service(intent.service()),
blob_length(0),
data_type(SERIALIZED) {
+ WebKit::WebVector<WebKit::WebString> names = intent.extrasNames();
darin (slow to review) 2012/04/30 18:31:25 it would help to get someone more familiar with Me
Greg Billock 2012/04/30 23:09:34 Sounds good. Should I split this off for separate
+ for (size_t i = 0; i < names.size(); ++i) {
+ extra_data[names[i]] = intent.extrasValue(names[i]);
+ }
+
+ // See WebMessagePortChannelImpl::postMessage() and ::OnMessagedQueued()
+ WebKit::WebMessagePortChannelArray* channels =
+ intent.messagePortChannelsRelease();
+ if (channels) {
+ for (size_t i = 0; i < channels->size(); ++i) {
+ WebMessagePortChannelImpl* webchannel =
+ static_cast<WebMessagePortChannelImpl*>((*channels)[i]);
+ message_port_ids.push_back(webchannel->message_port_id());
+ webchannel->QueueMessages(); // needed?
jam 2012/05/01 19:00:48 I don't quite remember why we needed this (it's be
+ DCHECK(message_port_ids[i] != MSG_ROUTING_NONE);
+ }
+ delete channels;
+ }
}
WebIntentData::WebIntentData(const string16& action_in,
« no previous file with comments | « webkit/glue/web_intent_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698