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 b2ac98ae250a91751e46c56ed4f7386a32ee8bde..0ca092e26d9539708f7b81d0f17a0c2262286c15 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_frame_host.h" |
#include "content/public/browser/render_process_host.h" |
#include "content/public/browser/storage_partition.h" |
+#include "content/public/common/push_messaging_status.h" |
#include "url/gurl.h" |
// Windows headers will redefine SendMessage. |
@@ -42,6 +43,8 @@ void ResultNoOp(bool success) { |
} |
void StatusNoOp(ServiceWorkerStatusCode status) { |
} |
+void PushDeliveryNoOp(PushDeliveryStatus status) { |
+} |
const std::string GetVersionRunningStatusString( |
content::ServiceWorkerVersion::RunningStatus running_status) { |
@@ -356,6 +359,23 @@ Response ServiceWorkerHandler::SetDebugOnStart(bool debug_on_start) { |
return Response::OK(); |
} |
+Response ServiceWorkerHandler::DeliverPushMessage( |
+ const std::string& origin, |
+ const std::string& registration_id, |
+ const std::string& data) { |
+ if (!enabled_) |
+ return Response::OK(); |
+ if (!render_frame_host_) |
+ return CreateContextErrorResoponse(); |
+ int64 id = 0; |
+ if (!base::StringToInt64(registration_id, &id)) |
+ return CreateInvalidVersionIdErrorResoponse(); |
+ BrowserContext::DeliverPushMessage( |
+ render_frame_host_->GetProcess()->GetBrowserContext(), GURL(origin), id, |
+ data, base::Bind(&PushDeliveryNoOp)); |
+ return Response::OK(); |
+} |
+ |
void ServiceWorkerHandler::OpenNewDevToolsWindow(int process_id, |
int devtools_agent_route_id) { |
scoped_refptr<DevToolsAgentHostImpl> agent_host( |