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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // MSG_ROUTING_NONE. When this provider host is for a Document, | 65 // MSG_ROUTING_NONE. When this provider host is for a Document, |
66 // |route_id| is the frame ID of the Document. When this provider host is for | 66 // |route_id| is the frame ID of the Document. When this provider host is for |
67 // a Shared Worker, |route_id| is the Shared Worker route ID. | 67 // a Shared Worker, |route_id| is the Shared Worker route ID. |
68 // |provider_type| gives additional information whether the provider is | 68 // |provider_type| gives additional information whether the provider is |
69 // created for controller (ServiceWorker) or controllee (Document or | 69 // created for controller (ServiceWorker) or controllee (Document or |
70 // SharedWorker). | 70 // SharedWorker). |
71 ServiceWorkerProviderHost(int render_process_id, | 71 ServiceWorkerProviderHost(int render_process_id, |
72 int route_id, | 72 int route_id, |
73 int provider_id, | 73 int provider_id, |
74 ServiceWorkerProviderType provider_type, | 74 ServiceWorkerProviderType provider_type, |
| 75 bool is_parent_frame_secure, |
75 base::WeakPtr<ServiceWorkerContextCore> context, | 76 base::WeakPtr<ServiceWorkerContextCore> context, |
76 ServiceWorkerDispatcherHost* dispatcher_host); | 77 ServiceWorkerDispatcherHost* dispatcher_host); |
77 virtual ~ServiceWorkerProviderHost(); | 78 virtual ~ServiceWorkerProviderHost(); |
78 | 79 |
79 const std::string& client_uuid() const { return client_uuid_; } | 80 const std::string& client_uuid() const { return client_uuid_; } |
80 int process_id() const { return render_process_id_; } | 81 int process_id() const { return render_process_id_; } |
81 int provider_id() const { return provider_id_; } | 82 int provider_id() const { return provider_id_; } |
82 int frame_id() const; | 83 int frame_id() const; |
83 int route_id() const { return route_id_; } | 84 int route_id() const { return route_id_; } |
84 | 85 |
| 86 bool is_parent_frame_secure() const { return is_parent_frame_secure_; } |
| 87 void set_parent_frame_secure(bool is_parent_frame_secure) { |
| 88 is_parent_frame_secure_ = is_parent_frame_secure; |
| 89 } |
| 90 |
85 bool IsHostToRunningServiceWorker() { | 91 bool IsHostToRunningServiceWorker() { |
86 return running_hosted_version_.get() != NULL; | 92 return running_hosted_version_.get() != NULL; |
87 } | 93 } |
88 | 94 |
89 ServiceWorkerVersion* controlling_version() const { | 95 ServiceWorkerVersion* controlling_version() const { |
90 return controlling_version_.get(); | 96 return controlling_version_.get(); |
91 } | 97 } |
92 ServiceWorkerVersion* active_version() const { | 98 ServiceWorkerVersion* active_version() const { |
93 return associated_registration_.get() ? | 99 return associated_registration_.get() ? |
94 associated_registration_->active_version() : NULL; | 100 associated_registration_->active_version() : NULL; |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 void FinalizeInitialization(int process_id, | 306 void FinalizeInitialization(int process_id, |
301 int frame_routing_id, | 307 int frame_routing_id, |
302 ServiceWorkerDispatcherHost* dispatcher_host); | 308 ServiceWorkerDispatcherHost* dispatcher_host); |
303 | 309 |
304 std::string client_uuid_; | 310 std::string client_uuid_; |
305 int render_process_id_; | 311 int render_process_id_; |
306 int route_id_; | 312 int route_id_; |
307 int render_thread_id_; | 313 int render_thread_id_; |
308 int provider_id_; | 314 int provider_id_; |
309 ServiceWorkerProviderType provider_type_; | 315 ServiceWorkerProviderType provider_type_; |
| 316 bool is_parent_frame_secure_; |
310 GURL document_url_; | 317 GURL document_url_; |
311 GURL topmost_frame_url_; | 318 GURL topmost_frame_url_; |
312 | 319 |
313 std::vector<GURL> associated_patterns_; | 320 std::vector<GURL> associated_patterns_; |
314 scoped_refptr<ServiceWorkerRegistration> associated_registration_; | 321 scoped_refptr<ServiceWorkerRegistration> associated_registration_; |
315 | 322 |
316 // Keyed by registration scope URL length. | 323 // Keyed by registration scope URL length. |
317 typedef std::map<size_t, scoped_refptr<ServiceWorkerRegistration>> | 324 typedef std::map<size_t, scoped_refptr<ServiceWorkerRegistration>> |
318 ServiceWorkerRegistrationMap; | 325 ServiceWorkerRegistrationMap; |
319 // Contains all living registrations which has pattern this document's | 326 // Contains all living registrations which has pattern this document's |
320 // URL starts with. | 327 // URL starts with. |
321 ServiceWorkerRegistrationMap matching_registrations_; | 328 ServiceWorkerRegistrationMap matching_registrations_; |
322 | 329 |
323 std::unique_ptr<OneShotGetReadyCallback> get_ready_callback_; | 330 std::unique_ptr<OneShotGetReadyCallback> get_ready_callback_; |
324 scoped_refptr<ServiceWorkerVersion> controlling_version_; | 331 scoped_refptr<ServiceWorkerVersion> controlling_version_; |
325 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; | 332 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; |
326 base::WeakPtr<ServiceWorkerContextCore> context_; | 333 base::WeakPtr<ServiceWorkerContextCore> context_; |
327 ServiceWorkerDispatcherHost* dispatcher_host_; | 334 ServiceWorkerDispatcherHost* dispatcher_host_; |
328 bool allow_association_; | 335 bool allow_association_; |
329 | 336 |
330 std::vector<base::Closure> queued_events_; | 337 std::vector<base::Closure> queued_events_; |
331 | 338 |
332 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); | 339 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); |
333 }; | 340 }; |
334 | 341 |
335 } // namespace content | 342 } // namespace content |
336 | 343 |
337 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 344 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
OLD | NEW |