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

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

Issue 2039743003: Introduce ServiceWorker.ActivatedWorkerPreparationForMainFrame.Time UMA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move GetWorkerPreparationSuffix Created 4 years, 6 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_provider_host.h" 5 #include "content/browser/service_worker/service_worker_provider_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 notify_controllerchange)); 185 notify_controllerchange));
186 } 186 }
187 187
188 bool ServiceWorkerProviderHost::SetHostedVersion( 188 bool ServiceWorkerProviderHost::SetHostedVersion(
189 ServiceWorkerVersion* version) { 189 ServiceWorkerVersion* version) {
190 // TODO(falken): Unclear why we check active_version. Should this just check 190 // TODO(falken): Unclear why we check active_version. Should this just check
191 // that IsProviderForClient() is false? 191 // that IsProviderForClient() is false?
192 if (active_version()) 192 if (active_version())
193 return false; // Unexpected bad message. 193 return false; // Unexpected bad message.
194 194
195 DCHECK_EQ(ServiceWorkerVersion::STARTING, version->running_status()); 195 DCHECK_EQ(ServiceWorkerVersion::RunningStatus::STARTING,
196 version->running_status());
196 if (version->embedded_worker()->process_id() != render_process_id_) { 197 if (version->embedded_worker()->process_id() != render_process_id_) {
197 // If we aren't trying to start this version in our process 198 // If we aren't trying to start this version in our process
198 // something is amiss. 199 // something is amiss.
199 return false; 200 return false;
200 } 201 }
201 202
202 running_hosted_version_ = version; 203 running_hosted_version_ = version;
203 return true; 204 return true;
204 } 205 }
205 206
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 Send(new ServiceWorkerMsg_SetControllerServiceWorker( 644 Send(new ServiceWorkerMsg_SetControllerServiceWorker(
644 render_thread_id_, provider_id(), 645 render_thread_id_, provider_id(),
645 GetOrCreateServiceWorkerHandle( 646 GetOrCreateServiceWorkerHandle(
646 associated_registration_->active_version()), 647 associated_registration_->active_version()),
647 false /* shouldNotifyControllerChange */)); 648 false /* shouldNotifyControllerChange */));
648 } 649 }
649 } 650 }
650 } 651 }
651 652
652 } // namespace content 653 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698