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

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

Issue 2968123002: Introduce ServiceWorkerRegistrationOptions struct for service worker options (Closed)
Patch Set: address more comments Created 3 years, 5 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_registration.h" 5 #include "content/browser/service_worker/service_worker_registration.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "content/browser/service_worker/embedded_worker_status.h" 10 #include "content/browser/service_worker/embedded_worker_status.h"
(...skipping 20 matching lines...) Expand all
31 31
32 ServiceWorkerVersionInfo GetVersionInfo(ServiceWorkerVersion* version) { 32 ServiceWorkerVersionInfo GetVersionInfo(ServiceWorkerVersion* version) {
33 if (!version) 33 if (!version)
34 return ServiceWorkerVersionInfo(); 34 return ServiceWorkerVersionInfo();
35 return version->GetInfo(); 35 return version->GetInfo();
36 } 36 }
37 37
38 } // namespace 38 } // namespace
39 39
40 ServiceWorkerRegistration::ServiceWorkerRegistration( 40 ServiceWorkerRegistration::ServiceWorkerRegistration(
41 const GURL& pattern, 41 const ServiceWorkerRegistrationOptions& options,
42 int64_t registration_id, 42 int64_t registration_id,
43 base::WeakPtr<ServiceWorkerContextCore> context) 43 base::WeakPtr<ServiceWorkerContextCore> context)
44 : pattern_(pattern), 44 : pattern_(options.scope),
45 registration_id_(registration_id), 45 registration_id_(registration_id),
46 is_deleted_(false), 46 is_deleted_(false),
47 is_uninstalling_(false), 47 is_uninstalling_(false),
48 is_uninstalled_(false), 48 is_uninstalled_(false),
49 should_activate_when_ready_(false), 49 should_activate_when_ready_(false),
50 resources_total_size_bytes_(0), 50 resources_total_size_bytes_(0),
51 context_(context), 51 context_(context),
52 task_runner_(base::ThreadTaskRunnerHandle::Get()) { 52 task_runner_(base::ThreadTaskRunnerHandle::Get()) {
53 DCHECK_CURRENTLY_ON(BrowserThread::IO); 53 DCHECK_CURRENTLY_ON(BrowserThread::IO);
54 DCHECK_NE(kInvalidServiceWorkerRegistrationId, registration_id); 54 DCHECK_NE(kInvalidServiceWorkerRegistrationId, registration_id);
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 if (!context_) { 566 if (!context_) {
567 callback.Run(SERVICE_WORKER_ERROR_ABORT); 567 callback.Run(SERVICE_WORKER_ERROR_ABORT);
568 return; 568 return;
569 } 569 }
570 context_->storage()->NotifyDoneInstallingRegistration( 570 context_->storage()->NotifyDoneInstallingRegistration(
571 this, version.get(), status); 571 this, version.get(), status);
572 callback.Run(status); 572 callback.Run(status);
573 } 573 }
574 574
575 } // namespace content 575 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698