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

Side by Side Diff: content/child/service_worker/service_worker_registration_handle_reference.h

Issue 2771823002: Implement updateViaCache flag and no-cache by default for main service worker scripts
Patch Set: fix tests Created 3 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 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 #ifndef CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_REFERENC E_H_ 5 #ifndef CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_REFERENC E_H_
6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_REFERENC E_H_ 6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_REFERENC E_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 22 matching lines...) Expand all
33 // Creates a new ServiceWorkerRegistrationHandleReference by adopting a 33 // Creates a new ServiceWorkerRegistrationHandleReference by adopting a
34 // ref-count. 34 // ref-count.
35 static std::unique_ptr<ServiceWorkerRegistrationHandleReference> Adopt( 35 static std::unique_ptr<ServiceWorkerRegistrationHandleReference> Adopt(
36 const ServiceWorkerRegistrationObjectInfo& info, 36 const ServiceWorkerRegistrationObjectInfo& info,
37 ThreadSafeSender* sender); 37 ThreadSafeSender* sender);
38 38
39 ~ServiceWorkerRegistrationHandleReference(); 39 ~ServiceWorkerRegistrationHandleReference();
40 40
41 const ServiceWorkerRegistrationObjectInfo& info() const { return info_; } 41 const ServiceWorkerRegistrationObjectInfo& info() const { return info_; }
42 int handle_id() const { return info_.handle_id; } 42 int handle_id() const { return info_.handle_id; }
43 GURL scope() const { return info_.scope; } 43 GURL scope() const { return info_.options.scope; }
44 bool use_cache() const {
45 return info_.options.use_cache ==
46 ServiceWorkerRegistrationOptions::UseCache::Use;
47 }
44 int64_t registration_id() const { return info_.registration_id; } 48 int64_t registration_id() const { return info_.registration_id; }
45 49
46 private: 50 private:
47 ServiceWorkerRegistrationHandleReference( 51 ServiceWorkerRegistrationHandleReference(
48 const ServiceWorkerRegistrationObjectInfo& info, 52 const ServiceWorkerRegistrationObjectInfo& info,
49 ThreadSafeSender* sender, 53 ThreadSafeSender* sender,
50 bool increment_ref_in_ctor); 54 bool increment_ref_in_ctor);
51 55
52 ServiceWorkerRegistrationObjectInfo info_; 56 ServiceWorkerRegistrationObjectInfo info_;
53 scoped_refptr<ThreadSafeSender> sender_; 57 scoped_refptr<ThreadSafeSender> sender_;
54 58
55 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistrationHandleReference); 59 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistrationHandleReference);
56 }; 60 };
57 61
58 } // namespace content 62 } // namespace content
59 63
60 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_REFER ENCE_H_ 64 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_HANDLE_REFER ENCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698