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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
16 #include "base/id_map.h" | 16 #include "base/id_map.h" |
17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
19 #include "base/observer_list.h" | 19 #include "base/observer_list.h" |
20 #include "base/timer/timer.h" | 20 #include "base/timer/timer.h" |
21 #include "content/browser/service_worker/embedded_worker_instance.h" | 21 #include "content/browser/service_worker/embedded_worker_instance.h" |
22 #include "content/browser/service_worker/service_worker_cache_listener.h" | 22 #include "content/browser/service_worker/service_worker_cache_listener.h" |
23 #include "content/browser/service_worker/service_worker_script_cache_map.h" | 23 #include "content/browser/service_worker/service_worker_script_cache_map.h" |
24 #include "content/common/content_export.h" | 24 #include "content/common/content_export.h" |
25 #include "content/common/service_worker/service_worker_status_code.h" | 25 #include "content/common/service_worker/service_worker_status_code.h" |
26 #include "content/common/service_worker/service_worker_types.h" | 26 #include "content/common/service_worker/service_worker_types.h" |
| 27 #include "net/ssl/ssl_info.h" |
27 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h" | 28 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h" |
28 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" | 29 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" |
29 | 30 |
30 class GURL; | 31 class GURL; |
31 | 32 |
32 namespace blink { | 33 namespace blink { |
33 struct WebCircularGeofencingRegion; | 34 struct WebCircularGeofencingRegion; |
34 } | 35 } |
35 | 36 |
36 namespace content { | 37 namespace content { |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 // Dooms this version to have REDUNDANT status and its resources deleted. If | 286 // 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 | 287 // the version is controlling a page, these changes will happen when the |
287 // version no longer controls any pages. | 288 // version no longer controls any pages. |
288 void Doom(); | 289 void Doom(); |
289 bool is_doomed() const { return is_doomed_; } | 290 bool is_doomed() const { return is_doomed_; } |
290 | 291 |
291 bool skip_waiting() const { return skip_waiting_; } | 292 bool skip_waiting() const { return skip_waiting_; } |
292 | 293 |
293 void SetDevToolsAttached(bool attached); | 294 void SetDevToolsAttached(bool attached); |
294 | 295 |
| 296 // Sets the SSLInfo of the main script. This SSLInfo will be used to fill the |
| 297 // SSLInfo of HttpResponseInfo of the response which will be sent back from |
| 298 // the ServiceWorker to the page to show the HTTPS padlock. |
| 299 void SetMainScriptSSLInfo(const net::SSLInfo& ssl_info); |
| 300 const net::SSLInfo& GetMainScriptSSLInfo(); |
| 301 |
295 private: | 302 private: |
296 class GetClientDocumentsCallback; | 303 class GetClientDocumentsCallback; |
297 | 304 |
298 friend class base::RefCounted<ServiceWorkerVersion>; | 305 friend class base::RefCounted<ServiceWorkerVersion>; |
299 friend class ServiceWorkerURLRequestJobTest; | 306 friend class ServiceWorkerURLRequestJobTest; |
300 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, | 307 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, |
301 ActivateWaitingVersion); | 308 ActivateWaitingVersion); |
302 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, ScheduleStopWorker); | 309 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, ScheduleStopWorker); |
303 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, KeepAlive); | 310 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, KeepAlive); |
304 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, ListenerAvailability); | 311 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, ListenerAvailability); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 ControlleeMap controllee_map_; | 409 ControlleeMap controllee_map_; |
403 ControlleeByIDMap controllee_by_id_; | 410 ControlleeByIDMap controllee_by_id_; |
404 base::WeakPtr<ServiceWorkerContextCore> context_; | 411 base::WeakPtr<ServiceWorkerContextCore> context_; |
405 ObserverList<Listener> listeners_; | 412 ObserverList<Listener> listeners_; |
406 ServiceWorkerScriptCacheMap script_cache_map_; | 413 ServiceWorkerScriptCacheMap script_cache_map_; |
407 base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_; | 414 base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_; |
408 base::OneShotTimer<ServiceWorkerVersion> update_timer_; | 415 base::OneShotTimer<ServiceWorkerVersion> update_timer_; |
409 bool is_doomed_; | 416 bool is_doomed_; |
410 std::vector<int> pending_skip_waiting_requests_; | 417 std::vector<int> pending_skip_waiting_requests_; |
411 bool skip_waiting_; | 418 bool skip_waiting_; |
| 419 net::SSLInfo main_script_ssl_info_; |
412 | 420 |
413 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 421 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
414 | 422 |
415 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 423 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
416 }; | 424 }; |
417 | 425 |
418 } // namespace content | 426 } // namespace content |
419 | 427 |
420 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 428 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
OLD | NEW |