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_PROVIDER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Returns true if the context referred to by this host (i.e. |context_|) is | 100 // Returns true if the context referred to by this host (i.e. |context_|) is |
101 // still alive. | 101 // still alive. |
102 bool IsContextAlive(); | 102 bool IsContextAlive(); |
103 | 103 |
104 // Dispatches message event to the document. | 104 // Dispatches message event to the document. |
105 void PostMessage(const base::string16& message, | 105 void PostMessage(const base::string16& message, |
106 const std::vector<int>& sent_message_port_ids); | 106 const std::vector<int>& sent_message_port_ids); |
107 | 107 |
108 private: | 108 private: |
109 friend class ServiceWorkerProviderHostTest; | 109 friend class ServiceWorkerProviderHostTest; |
| 110 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerContextRequestHandlerTest, |
| 111 UpdateBefore24Hours); |
| 112 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerContextRequestHandlerTest, |
| 113 UpdateAfter24Hours); |
110 | 114 |
111 // ServiceWorkerRegistration::Listener overrides. | 115 // ServiceWorkerRegistration::Listener overrides. |
112 virtual void OnVersionAttributesChanged( | 116 virtual void OnVersionAttributesChanged( |
113 ServiceWorkerRegistration* registration, | 117 ServiceWorkerRegistration* registration, |
114 ChangedVersionAttributesMask changed_mask, | 118 ChangedVersionAttributesMask changed_mask, |
115 const ServiceWorkerRegistrationInfo& info) OVERRIDE; | 119 const ServiceWorkerRegistrationInfo& info) OVERRIDE; |
116 virtual void OnRegistrationFailed( | 120 virtual void OnRegistrationFailed( |
117 ServiceWorkerRegistration* registration) OVERRIDE; | 121 ServiceWorkerRegistration* registration) OVERRIDE; |
118 | 122 |
119 // Sets the corresponding version field to the given version or if the given | 123 // Sets the corresponding version field to the given version or if the given |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; | 155 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; |
152 base::WeakPtr<ServiceWorkerContextCore> context_; | 156 base::WeakPtr<ServiceWorkerContextCore> context_; |
153 ServiceWorkerDispatcherHost* dispatcher_host_; | 157 ServiceWorkerDispatcherHost* dispatcher_host_; |
154 | 158 |
155 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); | 159 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); |
156 }; | 160 }; |
157 | 161 |
158 } // namespace content | 162 } // namespace content |
159 | 163 |
160 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 164 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
OLD | NEW |