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

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

Issue 2564363002: ServiceWorker: Replace RegistrationCallback and GetRegistrationsCallback with CallbackPromiseAdapter (Closed)
Patch Set: base::MakeUnique Created 4 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
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_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_ 5 #ifndef CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_
6 #define CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_ 6 #define CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 int64_t registrationId() const override; 71 int64_t registrationId() const override;
72 72
73 using WebServiceWorkerRegistrationHandle = 73 using WebServiceWorkerRegistrationHandle =
74 blink::WebServiceWorkerRegistration::Handle; 74 blink::WebServiceWorkerRegistration::Handle;
75 75
76 // Creates WebServiceWorkerRegistrationHandle object that owns a reference to 76 // Creates WebServiceWorkerRegistrationHandle object that owns a reference to
77 // the given WebServiceWorkerRegistrationImpl object. 77 // the given WebServiceWorkerRegistrationImpl object.
78 static std::unique_ptr<WebServiceWorkerRegistrationHandle> CreateHandle( 78 static std::unique_ptr<WebServiceWorkerRegistrationHandle> CreateHandle(
79 const scoped_refptr<WebServiceWorkerRegistrationImpl>& registration); 79 const scoped_refptr<WebServiceWorkerRegistrationImpl>& registration);
80 80
81 // Same with CreateHandle(), but returns a raw pointer to the handle w/ its
82 // ownership instead. The caller must manage the ownership. This function must
83 // be used only for passing the handle to Blink API that does not support
84 // blink::WebPassOwnPtr.
85 static WebServiceWorkerRegistrationHandle* CreateLeakyHandle(
86 const scoped_refptr<WebServiceWorkerRegistrationImpl>& registration);
87
88 private: 81 private:
89 friend class base::RefCounted<WebServiceWorkerRegistrationImpl>; 82 friend class base::RefCounted<WebServiceWorkerRegistrationImpl>;
90 ~WebServiceWorkerRegistrationImpl() override; 83 ~WebServiceWorkerRegistrationImpl() override;
91 84
92 enum QueuedTaskType { 85 enum QueuedTaskType {
93 INSTALLING, 86 INSTALLING,
94 WAITING, 87 WAITING,
95 ACTIVE, 88 ACTIVE,
96 UPDATE_FOUND, 89 UPDATE_FOUND,
97 }; 90 };
(...skipping 13 matching lines...) Expand all
111 blink::WebServiceWorkerRegistrationProxy* proxy_; 104 blink::WebServiceWorkerRegistrationProxy* proxy_;
112 105
113 std::vector<QueuedTask> queued_tasks_; 106 std::vector<QueuedTask> queued_tasks_;
114 107
115 DISALLOW_COPY_AND_ASSIGN(WebServiceWorkerRegistrationImpl); 108 DISALLOW_COPY_AND_ASSIGN(WebServiceWorkerRegistrationImpl);
116 }; 109 };
117 110
118 } // namespace content 111 } // namespace content
119 112
120 #endif // CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_ 113 #endif // CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_REGISTRATION_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698