| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 // The running version, if any, that this provider is providing resource | 77 // The running version, if any, that this provider is providing resource |
| 78 // loads for. | 78 // loads for. |
| 79 ServiceWorkerVersion* running_hosted_version() const { | 79 ServiceWorkerVersion* running_hosted_version() const { |
| 80 return running_hosted_version_.get(); | 80 return running_hosted_version_.get(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void SetDocumentUrl(const GURL& url); | 83 void SetDocumentUrl(const GURL& url); |
| 84 const GURL& document_url() const { return document_url_; } | 84 const GURL& document_url() const { return document_url_; } |
| 85 | 85 |
| 86 void SetTopmostFrameUrl(const GURL& url); |
| 87 const GURL& topmost_frame_url() const { return topmost_frame_url_; } |
| 88 |
| 86 // Associates to |registration| to listen for its version change events. | 89 // Associates to |registration| to listen for its version change events. |
| 87 void AssociateRegistration(ServiceWorkerRegistration* registration); | 90 void AssociateRegistration(ServiceWorkerRegistration* registration); |
| 88 | 91 |
| 89 // Clears the associated registration and stop listening to it. | 92 // Clears the associated registration and stop listening to it. |
| 90 void DisassociateRegistration(); | 93 void DisassociateRegistration(); |
| 91 | 94 |
| 92 // Returns false if the version is not in the expected STARTING in our | 95 // Returns false if the version is not in the expected STARTING in our |
| 93 // process state. That would be indicative of a bad IPC message. | 96 // process state. That would be indicative of a bad IPC message. |
| 94 bool SetHostedVersionId(int64 versions_id); | 97 bool SetHostedVersionId(int64 versions_id); |
| 95 | 98 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // provider is responsible for releasing the handle. | 147 // provider is responsible for releasing the handle. |
| 145 ServiceWorkerObjectInfo CreateHandleAndPass(ServiceWorkerVersion* version); | 148 ServiceWorkerObjectInfo CreateHandleAndPass(ServiceWorkerVersion* version); |
| 146 | 149 |
| 147 // Increase/decrease this host's process reference for |pattern|. | 150 // Increase/decrease this host's process reference for |pattern|. |
| 148 void IncreaseProcessReference(const GURL& pattern); | 151 void IncreaseProcessReference(const GURL& pattern); |
| 149 void DecreaseProcessReference(const GURL& pattern); | 152 void DecreaseProcessReference(const GURL& pattern); |
| 150 | 153 |
| 151 const int process_id_; | 154 const int process_id_; |
| 152 const int provider_id_; | 155 const int provider_id_; |
| 153 GURL document_url_; | 156 GURL document_url_; |
| 157 GURL topmost_frame_url_; |
| 154 | 158 |
| 155 std::vector<GURL> associated_patterns_; | 159 std::vector<GURL> associated_patterns_; |
| 156 scoped_refptr<ServiceWorkerRegistration> associated_registration_; | 160 scoped_refptr<ServiceWorkerRegistration> associated_registration_; |
| 157 | 161 |
| 158 scoped_refptr<ServiceWorkerVersion> controlling_version_; | 162 scoped_refptr<ServiceWorkerVersion> controlling_version_; |
| 159 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; | 163 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; |
| 160 base::WeakPtr<ServiceWorkerContextCore> context_; | 164 base::WeakPtr<ServiceWorkerContextCore> context_; |
| 161 ServiceWorkerDispatcherHost* dispatcher_host_; | 165 ServiceWorkerDispatcherHost* dispatcher_host_; |
| 162 bool allow_association_; | 166 bool allow_association_; |
| 163 | 167 |
| 164 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); | 168 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); |
| 165 }; | 169 }; |
| 166 | 170 |
| 167 } // namespace content | 171 } // namespace content |
| 168 | 172 |
| 169 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 173 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
| OLD | NEW |