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

Unified Diff: content/browser/navigator_connect/navigator_connect_service_worker_service_factory.cc

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: Update singly-included comment 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/browser/navigator_connect/navigator_connect_service_worker_service_factory.cc
diff --git a/content/browser/navigator_connect/navigator_connect_service_worker_service_factory.cc b/content/browser/navigator_connect/navigator_connect_service_worker_service_factory.cc
index 1fc27f3321d158f073eda950a187e94cff6291e3..149ba81f2462cf993d047b84088ee1554515ffcc 100644
--- a/content/browser/navigator_connect/navigator_connect_service_worker_service_factory.cc
+++ b/content/browser/navigator_connect/navigator_connect_service_worker_service_factory.cc
@@ -31,7 +31,7 @@ class NavigatorConnectServiceWorkerService : public MessagePortDelegate {
// MessagePortDelegate implementation.
void SendMessage(int route_id,
- const base::string16& message,
+ const MessagePortMessage& message,
const std::vector<int>& sent_message_port_ids) override;
void SendMessagesAreQueued(int route_id) override;
@@ -69,9 +69,10 @@ NavigatorConnectServiceWorkerService::~NavigatorConnectServiceWorkerService() {
void NavigatorConnectServiceWorkerService::SendMessage(
int route_id,
- const base::string16& message,
+ const MessagePortMessage& message,
const std::vector<int>& sent_message_port_ids) {
DCHECK(route_id == client_.message_port_id);
+ DCHECK(message.message_as_value.empty());
// Hold messages on transferred message ports. Actual delivery of the message
// by the service can be asynchronous. When a message is delivered,
@@ -83,7 +84,8 @@ void NavigatorConnectServiceWorkerService::SendMessage(
service_worker_context_->context()->storage()->FindRegistrationForId(
service_worker_registration_id_, service_worker_registration_origin_,
base::Bind(&NavigatorConnectServiceWorkerService::DeliverMessage,
- weak_factory_.GetWeakPtr(), message, sent_message_port_ids));
+ weak_factory_.GetWeakPtr(), message.message_as_string,
+ sent_message_port_ids));
}
void NavigatorConnectServiceWorkerService::SendMessagesAreQueued(int route_id) {
« no previous file with comments | « content/browser/message_port_service.cc ('k') | content/browser/shared_worker/shared_worker_service_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698