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

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

Issue 1815363002: Add RetainedRef uses where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_controllee_request_handl er.h" 5 #include "content/browser/service_worker/service_worker_controllee_request_handl er.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 if (registration->waiting_version()) 226 if (registration->waiting_version())
227 registration->ActivateWaitingVersionWhenReady(); 227 registration->ActivateWaitingVersionWhenReady();
228 228
229 scoped_refptr<ServiceWorkerVersion> active_version = 229 scoped_refptr<ServiceWorkerVersion> active_version =
230 registration->active_version(); 230 registration->active_version();
231 231
232 // Wait until it's activated before firing fetch events. 232 // Wait until it's activated before firing fetch events.
233 if (active_version.get() && 233 if (active_version.get() &&
234 active_version->status() == ServiceWorkerVersion::ACTIVATING) { 234 active_version->status() == ServiceWorkerVersion::ACTIVATING) {
235 provider_host_->SetAllowAssociation(false); 235 provider_host_->SetAllowAssociation(false);
236 registration->active_version()->RegisterStatusChangeCallback( 236 registration->active_version()->RegisterStatusChangeCallback(base::Bind(
237 base::Bind(&self::OnVersionStatusChanged, 237 &self::OnVersionStatusChanged, weak_factory_.GetWeakPtr(),
238 weak_factory_.GetWeakPtr(), 238 base::RetainedRef(registration), base::RetainedRef(active_version)));
239 registration,
240 active_version));
241 TRACE_EVENT_ASYNC_END2( 239 TRACE_EVENT_ASYNC_END2(
242 "ServiceWorker", 240 "ServiceWorker",
243 "ServiceWorkerControlleeRequestHandler::PrepareForMainResource", 241 "ServiceWorkerControlleeRequestHandler::PrepareForMainResource",
244 job_.get(), 242 job_.get(),
245 "Status", status, 243 "Status", status,
246 "Info", "Wait until finished SW activation"); 244 "Info", "Wait until finished SW activation");
247 return; 245 return;
248 } 246 }
249 247
250 // Ignore a SW that failed too much as a safety measure. 248 // Ignore a SW that failed too much as a safety measure.
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 void ServiceWorkerControlleeRequestHandler::ClearJob() { 453 void ServiceWorkerControlleeRequestHandler::ClearJob() {
456 job_.reset(); 454 job_.reset();
457 was_fetched_via_service_worker_ = false; 455 was_fetched_via_service_worker_ = false;
458 was_fallback_required_ = false; 456 was_fallback_required_ = false;
459 original_url_via_service_worker_ = GURL(); 457 original_url_via_service_worker_ = GURL();
460 response_type_via_service_worker_ = 458 response_type_via_service_worker_ =
461 blink::WebServiceWorkerResponseTypeDefault; 459 blink::WebServiceWorkerResponseTypeDefault;
462 } 460 }
463 461
464 } // namespace content 462 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698