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

Side by Side Diff: content/browser/service_worker/service_worker_dispatcher_host.cc

Issue 1795863006: service worker: Attribute purpose to start worker attempts for UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: patch for landing? Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/service_worker/service_worker_dispatcher_host.h" 5 #include "content/browser/service_worker/service_worker_dispatcher_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 const base::string16& message, 871 const base::string16& message,
872 const url::Origin& source_origin, 872 const url::Origin& source_origin,
873 const std::vector<TransferredMessagePort>& sent_message_ports, 873 const std::vector<TransferredMessagePort>& sent_message_ports,
874 const SourceInfo& source_info) { 874 const SourceInfo& source_info) {
875 if (!source_info.IsValid()) { 875 if (!source_info.IsValid()) {
876 DidFailToDispatchExtendableMessageEvent(sent_message_ports, 876 DidFailToDispatchExtendableMessageEvent(sent_message_ports,
877 SERVICE_WORKER_ERROR_FAILED); 877 SERVICE_WORKER_ERROR_FAILED);
878 return; 878 return;
879 } 879 }
880 worker->RunAfterStartWorker( 880 worker->RunAfterStartWorker(
881 ServiceWorkerMetrics::EventType::MESSAGE,
881 base::Bind(&ServiceWorkerDispatcherHost:: 882 base::Bind(&ServiceWorkerDispatcherHost::
882 DispatchExtendableMessageEventAfterStartWorker, 883 DispatchExtendableMessageEventAfterStartWorker,
883 this, worker, message, source_origin, sent_message_ports, 884 this, worker, message, source_origin, sent_message_ports,
884 ExtendableMessageEventSource(source_info)), 885 ExtendableMessageEventSource(source_info)),
885 base::Bind( 886 base::Bind(
886 &ServiceWorkerDispatcherHost::DidFailToDispatchExtendableMessageEvent, 887 &ServiceWorkerDispatcherHost::DidFailToDispatchExtendableMessageEvent,
887 this, sent_message_ports)); 888 this, sent_message_ports));
888 } 889 }
889 890
890 void ServiceWorkerDispatcherHost:: 891 void ServiceWorkerDispatcherHost::
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 if (!handle) { 1390 if (!handle) {
1390 bad_message::ReceivedBadMessage(this, 1391 bad_message::ReceivedBadMessage(this,
1391 bad_message::SWDH_TERMINATE_BAD_HANDLE); 1392 bad_message::SWDH_TERMINATE_BAD_HANDLE);
1392 return; 1393 return;
1393 } 1394 }
1394 handle->version()->StopWorker( 1395 handle->version()->StopWorker(
1395 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); 1396 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback));
1396 } 1397 }
1397 1398
1398 } // namespace content 1399 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698