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

Unified Diff: content/browser/devtools/protocol/service_worker_handler.cc

Issue 1636483002: Update the PushEvent to have a nullable PushMessageData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review comments and include Created 4 years, 11 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/browser/browser_context.cc ('k') | content/browser/push_messaging/push_messaging_router.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/devtools/protocol/service_worker_handler.cc
diff --git a/content/browser/devtools/protocol/service_worker_handler.cc b/content/browser/devtools/protocol/service_worker_handler.cc
index 5571421990fd38acd12bab0f0a53e62f4693a09b..d4842fa36453ed1362a1858bb2b0a26891a8e2a3 100644
--- a/content/browser/devtools/protocol/service_worker_handler.cc
+++ b/content/browser/devtools/protocol/service_worker_handler.cc
@@ -23,6 +23,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/push_event_payload.h"
#include "content/public/common/push_messaging_status.h"
#include "url/gurl.h"
@@ -437,9 +438,12 @@ Response ServiceWorkerHandler::DeliverPushMessage(
int64_t id = 0;
if (!base::StringToInt64(registration_id, &id))
return CreateInvalidVersionIdErrorResponse();
+ PushEventPayload payload;
+ if (data.size() > 0)
+ payload.setData(data);
BrowserContext::DeliverPushMessage(
render_frame_host_->GetProcess()->GetBrowserContext(), GURL(origin), id,
- data, base::Bind(&PushDeliveryNoOp));
+ payload, base::Bind(&PushDeliveryNoOp));
return Response::OK();
}
« no previous file with comments | « content/browser/browser_context.cc ('k') | content/browser/push_messaging/push_messaging_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698