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

Side by Side Diff: content/browser/service_worker/service_worker_dispatcher_host.h

Issue 1307133003: ServiceWorker: Make APIs that return ServiceWorkerRegistration coin a new JS object (2/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split CreateRegistration() Created 5 years, 3 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_dispatcher_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/id_map.h" 10 #include "base/id_map.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // be destroyed. 58 // be destroyed.
59 bool Send(IPC::Message* message) override; 59 bool Send(IPC::Message* message) override;
60 60
61 void RegisterServiceWorkerHandle(scoped_ptr<ServiceWorkerHandle> handle); 61 void RegisterServiceWorkerHandle(scoped_ptr<ServiceWorkerHandle> handle);
62 void RegisterServiceWorkerRegistrationHandle( 62 void RegisterServiceWorkerRegistrationHandle(
63 scoped_ptr<ServiceWorkerRegistrationHandle> handle); 63 scoped_ptr<ServiceWorkerRegistrationHandle> handle);
64 64
65 ServiceWorkerHandle* FindServiceWorkerHandle(int provider_id, 65 ServiceWorkerHandle* FindServiceWorkerHandle(int provider_id,
66 int64 version_id); 66 int64 version_id);
67 67
68 // Returns the existing registration handle whose reference count is 68 // Creates a new registration handle and registers it.
69 // incremented or newly created one if it doesn't exist. 69 ServiceWorkerRegistrationHandle* CreateRegistrationHandle(
70 ServiceWorkerRegistrationHandle* GetOrCreateRegistrationHandle(
71 base::WeakPtr<ServiceWorkerProviderHost> provider_host, 70 base::WeakPtr<ServiceWorkerProviderHost> provider_host,
72 ServiceWorkerRegistration* registration); 71 ServiceWorkerRegistration* registration);
73 72
74 MessagePortMessageFilter* message_port_message_filter() { 73 MessagePortMessageFilter* message_port_message_filter() {
75 return message_port_message_filter_; 74 return message_port_message_filter_;
76 } 75 }
77 76
78 protected: 77 protected:
79 ~ServiceWorkerDispatcherHost() override; 78 ~ServiceWorkerDispatcherHost() override;
80 79
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 void OnDecrementServiceWorkerRefCount(int handle_id); 129 void OnDecrementServiceWorkerRefCount(int handle_id);
131 void OnIncrementRegistrationRefCount(int registration_handle_id); 130 void OnIncrementRegistrationRefCount(int registration_handle_id);
132 void OnDecrementRegistrationRefCount(int registration_handle_id); 131 void OnDecrementRegistrationRefCount(int registration_handle_id);
133 void OnPostMessageToWorker( 132 void OnPostMessageToWorker(
134 int handle_id, 133 int handle_id,
135 const base::string16& message, 134 const base::string16& message,
136 const std::vector<TransferredMessagePort>& sent_message_ports); 135 const std::vector<TransferredMessagePort>& sent_message_ports);
137 void OnServiceWorkerObjectDestroyed(int handle_id); 136 void OnServiceWorkerObjectDestroyed(int handle_id);
138 void OnTerminateWorker(int handle_id); 137 void OnTerminateWorker(int handle_id);
139 138
140 ServiceWorkerRegistrationHandle* FindRegistrationHandle(
141 int provider_id,
142 int64 registration_id);
143
144 void GetRegistrationObjectInfoAndVersionAttributes( 139 void GetRegistrationObjectInfoAndVersionAttributes(
145 base::WeakPtr<ServiceWorkerProviderHost> provider_host, 140 base::WeakPtr<ServiceWorkerProviderHost> provider_host,
146 ServiceWorkerRegistration* registration, 141 ServiceWorkerRegistration* registration,
147 ServiceWorkerRegistrationObjectInfo* info, 142 ServiceWorkerRegistrationObjectInfo* info,
148 ServiceWorkerVersionAttributes* attrs); 143 ServiceWorkerVersionAttributes* attrs);
149 144
150 // Callbacks from ServiceWorkerContextCore 145 // Callbacks from ServiceWorkerContextCore
151 void RegistrationComplete(int thread_id, 146 void RegistrationComplete(int thread_id,
152 int provider_id, 147 int provider_id,
153 int request_id, 148 int request_id,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 215
221 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. 216 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL.
222 ScopedVector<IPC::Message> pending_messages_; 217 ScopedVector<IPC::Message> pending_messages_;
223 218
224 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); 219 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost);
225 }; 220 };
226 221
227 } // namespace content 222 } // namespace content
228 223
229 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ 224 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698