OLD | NEW |
---|---|
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 <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 15 matching lines...) Expand all Loading... | |
26 #include "content/common/service_worker/service_worker_types.h" | 26 #include "content/common/service_worker/service_worker_types.h" |
27 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h" | 27 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h" |
28 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" | 28 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" |
29 | 29 |
30 class GURL; | 30 class GURL; |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 struct WebCircularGeofencingRegion; | 33 struct WebCircularGeofencingRegion; |
34 } | 34 } |
35 | 35 |
36 namespace net { | |
37 class HttpResponseInfo; | |
38 } | |
39 | |
36 namespace content { | 40 namespace content { |
37 | 41 |
38 class EmbeddedWorkerRegistry; | 42 class EmbeddedWorkerRegistry; |
39 struct NavigatorConnectClient; | 43 struct NavigatorConnectClient; |
40 struct PlatformNotificationData; | 44 struct PlatformNotificationData; |
41 class ServiceWorkerContextCore; | 45 class ServiceWorkerContextCore; |
42 class ServiceWorkerProviderHost; | 46 class ServiceWorkerProviderHost; |
43 class ServiceWorkerRegistration; | 47 class ServiceWorkerRegistration; |
44 class ServiceWorkerURLRequestJob; | 48 class ServiceWorkerURLRequestJob; |
45 class ServiceWorkerVersionInfo; | 49 class ServiceWorkerVersionInfo; |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
285 // Dooms this version to have REDUNDANT status and its resources deleted. If | 289 // Dooms this version to have REDUNDANT status and its resources deleted. If |
286 // the version is controlling a page, these changes will happen when the | 290 // the version is controlling a page, these changes will happen when the |
287 // version no longer controls any pages. | 291 // version no longer controls any pages. |
288 void Doom(); | 292 void Doom(); |
289 bool is_doomed() const { return is_doomed_; } | 293 bool is_doomed() const { return is_doomed_; } |
290 | 294 |
291 bool skip_waiting() const { return skip_waiting_; } | 295 bool skip_waiting() const { return skip_waiting_; } |
292 | 296 |
293 void SetDevToolsAttached(bool attached); | 297 void SetDevToolsAttached(bool attached); |
294 | 298 |
299 // Sets the HttpResponseInfo of the main script. This HttpResponseInfo will be | |
300 // used to fill the HttpResponseInfo of the response which will be sent back | |
301 // from the ServiceWorker to the page to show the HTTPS padlock. | |
Ryan Sleevi
2015/02/02 19:39:07
comment nit: Reads a bit weird
// Sets the HttpRe
horo
2015/02/02 20:04:28
Done.
| |
302 void SetMainScriptHttpResponseInfo(const net::HttpResponseInfo& http_info); | |
303 const net::HttpResponseInfo* GetMainScriptHttpResponseInfo(); | |
304 | |
295 private: | 305 private: |
296 class GetClientDocumentsCallback; | 306 class GetClientDocumentsCallback; |
297 | 307 |
298 friend class base::RefCounted<ServiceWorkerVersion>; | 308 friend class base::RefCounted<ServiceWorkerVersion>; |
299 friend class ServiceWorkerURLRequestJobTest; | 309 friend class ServiceWorkerURLRequestJobTest; |
300 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, | 310 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, |
301 ActivateWaitingVersion); | 311 ActivateWaitingVersion); |
302 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, ScheduleStopWorker); | 312 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, ScheduleStopWorker); |
303 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, KeepAlive); | 313 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, KeepAlive); |
304 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, ListenerAvailability); | 314 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, ListenerAvailability); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
402 ControlleeMap controllee_map_; | 412 ControlleeMap controllee_map_; |
403 ControlleeByIDMap controllee_by_id_; | 413 ControlleeByIDMap controllee_by_id_; |
404 base::WeakPtr<ServiceWorkerContextCore> context_; | 414 base::WeakPtr<ServiceWorkerContextCore> context_; |
405 ObserverList<Listener> listeners_; | 415 ObserverList<Listener> listeners_; |
406 ServiceWorkerScriptCacheMap script_cache_map_; | 416 ServiceWorkerScriptCacheMap script_cache_map_; |
407 base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_; | 417 base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_; |
408 base::OneShotTimer<ServiceWorkerVersion> update_timer_; | 418 base::OneShotTimer<ServiceWorkerVersion> update_timer_; |
409 bool is_doomed_; | 419 bool is_doomed_; |
410 std::vector<int> pending_skip_waiting_requests_; | 420 std::vector<int> pending_skip_waiting_requests_; |
411 bool skip_waiting_; | 421 bool skip_waiting_; |
422 scoped_ptr<net::HttpResponseInfo> main_script_http_info_; | |
412 | 423 |
413 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 424 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
414 | 425 |
415 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 426 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
416 }; | 427 }; |
417 | 428 |
418 } // namespace content | 429 } // namespace content |
419 | 430 |
420 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 431 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
OLD | NEW |