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

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

Issue 379303002: Content blink::WebServiceWorkerCacheStorage implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: meets presubmit! Created 6 years, 4 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 | Annotate | Revision Log
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_VERSION_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/gtest_prod_util.h" 14 #include "base/gtest_prod_util.h"
15 #include "base/id_map.h" 15 #include "base/id_map.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/memory/scoped_ptr.h" 17 #include "base/memory/scoped_ptr.h"
18 #include "base/observer_list.h" 18 #include "base/observer_list.h"
19 #include "base/timer/timer.h" 19 #include "base/timer/timer.h"
20 #include "content/browser/service_worker/embedded_worker_instance.h" 20 #include "content/browser/service_worker/embedded_worker_instance.h"
21 #include "content/browser/service_worker/service_worker_cache_listener.h"
21 #include "content/browser/service_worker/service_worker_script_cache_map.h" 22 #include "content/browser/service_worker/service_worker_script_cache_map.h"
22 #include "content/common/content_export.h" 23 #include "content/common/content_export.h"
23 #include "content/common/service_worker/service_worker_status_code.h" 24 #include "content/common/service_worker/service_worker_status_code.h"
24 #include "content/common/service_worker/service_worker_types.h" 25 #include "content/common/service_worker/service_worker_types.h"
25 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" 26 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h"
26 27
27 class GURL; 28 class GURL;
28 29
29 namespace content { 30 namespace content {
30 31
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 blink::WebServiceWorkerEventResult result); 265 blink::WebServiceWorkerEventResult result);
265 void OnFetchEventFinished(int request_id, 266 void OnFetchEventFinished(int request_id,
266 ServiceWorkerFetchEventResult result, 267 ServiceWorkerFetchEventResult result,
267 const ServiceWorkerResponse& response); 268 const ServiceWorkerResponse& response);
268 void OnSyncEventFinished(int request_id); 269 void OnSyncEventFinished(int request_id);
269 void OnPushEventFinished(int request_id); 270 void OnPushEventFinished(int request_id);
270 void OnPostMessageToDocument(int client_id, 271 void OnPostMessageToDocument(int client_id,
271 const base::string16& message, 272 const base::string16& message,
272 const std::vector<int>& sent_message_port_ids); 273 const std::vector<int>& sent_message_port_ids);
273 274
275
274 void ScheduleStopWorker(); 276 void ScheduleStopWorker();
275 void DoomInternal(); 277 void DoomInternal();
276 278
277 const int64 version_id_; 279 const int64 version_id_;
278 int64 registration_id_; 280 int64 registration_id_;
279 GURL script_url_; 281 GURL script_url_;
280 GURL scope_; 282 GURL scope_;
281 Status status_; 283 Status status_;
282 scoped_ptr<EmbeddedWorkerInstance> embedded_worker_; 284 scoped_ptr<EmbeddedWorkerInstance> embedded_worker_;
285 scoped_ptr<ServiceWorkerCacheListener> cache_listener_;
283 std::vector<StatusCallback> start_callbacks_; 286 std::vector<StatusCallback> start_callbacks_;
284 std::vector<StatusCallback> stop_callbacks_; 287 std::vector<StatusCallback> stop_callbacks_;
285 std::vector<base::Closure> status_change_callbacks_; 288 std::vector<base::Closure> status_change_callbacks_;
286 289
287 // Message callbacks. 290 // Message callbacks.
288 IDMap<StatusCallback, IDMapOwnPointer> activate_callbacks_; 291 IDMap<StatusCallback, IDMapOwnPointer> activate_callbacks_;
289 IDMap<StatusCallback, IDMapOwnPointer> install_callbacks_; 292 IDMap<StatusCallback, IDMapOwnPointer> install_callbacks_;
290 IDMap<FetchCallback, IDMapOwnPointer> fetch_callbacks_; 293 IDMap<FetchCallback, IDMapOwnPointer> fetch_callbacks_;
291 IDMap<StatusCallback, IDMapOwnPointer> sync_callbacks_; 294 IDMap<StatusCallback, IDMapOwnPointer> sync_callbacks_;
292 IDMap<StatusCallback, IDMapOwnPointer> push_callbacks_; 295 IDMap<StatusCallback, IDMapOwnPointer> push_callbacks_;
293 296
294 ControlleeMap controllee_map_; 297 ControlleeMap controllee_map_;
295 ControlleeByIDMap controllee_by_id_; 298 ControlleeByIDMap controllee_by_id_;
296 base::WeakPtr<ServiceWorkerContextCore> context_; 299 base::WeakPtr<ServiceWorkerContextCore> context_;
297 ObserverList<Listener> listeners_; 300 ObserverList<Listener> listeners_;
298 ServiceWorkerScriptCacheMap script_cache_map_; 301 ServiceWorkerScriptCacheMap script_cache_map_;
299 base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_; 302 base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_;
300 base::OneShotTimer<ServiceWorkerVersion> update_timer_; 303 base::OneShotTimer<ServiceWorkerVersion> update_timer_;
301 bool is_doomed_; 304 bool is_doomed_;
302 305
303 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; 306 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_;
304 307
305 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); 308 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion);
306 }; 309 };
307 310
308 } // namespace content 311 } // namespace content
309 312
310 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 313 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698