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

Unified Diff: content/worker/webworker_stub.cc

Issue 7477027: Support Transferable objects (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Update for interface changes. Created 9 years, 4 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 | « content/renderer/webworker_proxy.cc ('k') | content/worker/webworkerclient_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/worker/webworker_stub.cc
diff --git a/content/worker/webworker_stub.cc b/content/worker/webworker_stub.cc
index f782bb34d027612909cc74bca5ad19719df0953a..c146a65a96773e6d2e40c45845709d2a44464215 100644
--- a/content/worker/webworker_stub.cc
+++ b/content/worker/webworker_stub.cc
@@ -11,6 +11,7 @@
#include "content/common/webmessageportchannel_impl.h"
#include "content/common/worker_messages.h"
#include "content/worker/worker_devtools_agent.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebMessagePortChannel.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebWorker.h"
@@ -71,11 +72,23 @@ void WebWorkerStub::OnPostMessage(
const string16& message,
const std::vector<int>& sent_message_port_ids,
const std::vector<int>& new_routing_ids) {
- WebKit::WebMessagePortChannelArray channels(sent_message_port_ids.size());
+ WebKit::WebTransferableReceiptArray receipts(sent_message_port_ids.size());
for (size_t i = 0; i < sent_message_port_ids.size(); i++) {
- channels[i] = new WebMessagePortChannelImpl(
+ WebMessagePortChannelImpl* impl = new WebMessagePortChannelImpl(
new_routing_ids[i], sent_message_port_ids[i]);
+#ifndef WebTransferableReceipt_h
+ receipts[i] = impl;
+#else
+ receipts[i] = new WebKit::WebMessagePortReceipt(impl);
+#endif
}
- impl_->postMessageToWorkerContext(message, channels);
+ impl_->postMessageToWorkerContext(message, receipts);
+
+#ifdef WebTransferableReceipt_h
+ for (size_t i = 0; i < receipts.size(); ++i) {
+ delete receipts[i];
+ receipts[i] = 0;
+ }
+#endif
}
« no previous file with comments | « content/renderer/webworker_proxy.cc ('k') | content/worker/webworkerclient_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698