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

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

Issue 1063823005: Service Worker: Use more specific errors when StartWorker fails (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update histograms.xml Created 5 years, 8 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_context_wrapper.h" 5 #include "content/browser/service_worker/service_worker_context_wrapper.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 const StatusCallback& callback) { 242 const StatusCallback& callback) {
243 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { 243 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
244 BrowserThread::PostTask( 244 BrowserThread::PostTask(
245 BrowserThread::IO, FROM_HERE, 245 BrowserThread::IO, FROM_HERE,
246 base::Bind(&ServiceWorkerContextWrapper::StartServiceWorker, this, 246 base::Bind(&ServiceWorkerContextWrapper::StartServiceWorker, this,
247 pattern, callback)); 247 pattern, callback));
248 return; 248 return;
249 } 249 }
250 if (!context_core_.get()) { 250 if (!context_core_.get()) {
251 LOG(ERROR) << "ServiceWorkerContextCore is no longer alive."; 251 LOG(ERROR) << "ServiceWorkerContextCore is no longer alive.";
252 BrowserThread::PostTask( 252 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
253 BrowserThread::UI, FROM_HERE, 253 base::Bind(callback, SERVICE_WORKER_ERROR_ABORT));
254 base::Bind(callback, SERVICE_WORKER_ERROR_START_WORKER_FAILED));
255 return; 254 return;
256 } 255 }
257 context_core_->storage()->FindRegistrationForPattern( 256 context_core_->storage()->FindRegistrationForPattern(
258 pattern, base::Bind(&StartActiveWorkerOnIO, callback)); 257 pattern, base::Bind(&StartActiveWorkerOnIO, callback));
259 } 258 }
260 259
261 static void DidFindRegistrationForDocument( 260 static void DidFindRegistrationForDocument(
262 const net::CompletionCallback& callback, 261 const net::CompletionCallback& callback,
263 ServiceWorkerStatusCode status, 262 ServiceWorkerStatusCode status,
264 const scoped_refptr<ServiceWorkerRegistration>& registration) { 263 const scoped_refptr<ServiceWorkerRegistration>& registration) {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 return; 448 return;
450 } 449 }
451 context_core_.reset(new ServiceWorkerContextCore(context_core_.get(), this)); 450 context_core_.reset(new ServiceWorkerContextCore(context_core_.get(), this));
452 DVLOG(1) << "Restarted ServiceWorkerContextCore successfully."; 451 DVLOG(1) << "Restarted ServiceWorkerContextCore successfully.";
453 452
454 observer_list_->Notify(FROM_HERE, 453 observer_list_->Notify(FROM_HERE,
455 &ServiceWorkerContextObserver::OnStorageWiped); 454 &ServiceWorkerContextObserver::OnStorageWiped);
456 } 455 }
457 456
458 } // namespace content 457 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698