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

Side by Side Diff: content/child/service_worker/service_worker_provider_context.cc

Issue 1478103002: [WIP] [service worker] Fix detach controller and fallback to network mechanism (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: return null in Create/Adopt Created 5 years 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
« no previous file with comments | « content/child/service_worker/service_worker_handle_reference.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/child/service_worker/service_worker_provider_context.h" 5 #include "content/child/service_worker/service_worker_provider_context.h"
6 6
7 #include "base/thread_task_runner_handle.h" 7 #include "base/thread_task_runner_handle.h"
8 #include "content/child/child_thread_impl.h" 8 #include "content/child/child_thread_impl.h"
9 #include "content/child/service_worker/service_worker_dispatcher.h" 9 #include "content/child/service_worker/service_worker_dispatcher.h"
10 #include "content/child/service_worker/service_worker_handle_reference.h" 10 #include "content/child/service_worker/service_worker_handle_reference.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 50 }
51 51
52 void DisassociateRegistration() override { 52 void DisassociateRegistration() override {
53 controller_.reset(); 53 controller_.reset();
54 registration_.reset(); 54 registration_.reset();
55 } 55 }
56 56
57 void SetController( 57 void SetController(
58 scoped_ptr<ServiceWorkerHandleReference> controller) override { 58 scoped_ptr<ServiceWorkerHandleReference> controller) override {
59 DCHECK(registration_); 59 DCHECK(registration_);
60 DCHECK(!controller ||
61 controller->handle_id() != kInvalidServiceWorkerHandleId);
60 controller_ = controller.Pass(); 62 controller_ = controller.Pass();
61 } 63 }
62 64
63 void GetAssociatedRegistration( 65 void GetAssociatedRegistration(
64 ServiceWorkerRegistrationObjectInfo* info, 66 ServiceWorkerRegistrationObjectInfo* info,
65 ServiceWorkerVersionAttributes* attrs) override { 67 ServiceWorkerVersionAttributes* attrs) override {
66 NOTREACHED(); 68 NOTREACHED();
67 } 69 }
68 70
69 ServiceWorkerHandleReference* controller() override { 71 ServiceWorkerHandleReference* controller() override {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 199
198 void ServiceWorkerProviderContext::DestructOnMainThread() const { 200 void ServiceWorkerProviderContext::DestructOnMainThread() const {
199 if (!main_thread_task_runner_->RunsTasksOnCurrentThread() && 201 if (!main_thread_task_runner_->RunsTasksOnCurrentThread() &&
200 main_thread_task_runner_->DeleteSoon(FROM_HERE, this)) { 202 main_thread_task_runner_->DeleteSoon(FROM_HERE, this)) {
201 return; 203 return;
202 } 204 }
203 delete this; 205 delete this;
204 } 206 }
205 207
206 } // namespace content 208 } // namespace content
OLDNEW
« no previous file with comments | « content/child/service_worker/service_worker_handle_reference.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698