| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // Returns a handler for a request, the handler may return NULL if | 86 // Returns a handler for a request, the handler may return NULL if |
| 87 // the request doesn't require special handling. | 87 // the request doesn't require special handling. |
| 88 scoped_ptr<ServiceWorkerRequestHandler> CreateRequestHandler( | 88 scoped_ptr<ServiceWorkerRequestHandler> CreateRequestHandler( |
| 89 ResourceType::Type resource_type, | 89 ResourceType::Type resource_type, |
| 90 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context); | 90 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context); |
| 91 | 91 |
| 92 // Dispatches message event to the document. | 92 // Dispatches message event to the document. |
| 93 void PostMessage(const base::string16& message, | 93 void PostMessage(const base::string16& message, |
| 94 const std::vector<int>& sent_message_port_ids); | 94 const std::vector<int>& sent_message_port_ids); |
| 95 | 95 |
| 96 // Returns true if the context referred to by this host (i.e. |context_|) is |
| 97 // still alive. |
| 98 bool IsAlive(); |
| 99 |
| 96 private: | 100 private: |
| 97 const int process_id_; | 101 const int process_id_; |
| 98 const int provider_id_; | 102 const int provider_id_; |
| 99 GURL document_url_; | 103 GURL document_url_; |
| 100 scoped_refptr<ServiceWorkerVersion> active_version_; | 104 scoped_refptr<ServiceWorkerVersion> active_version_; |
| 101 scoped_refptr<ServiceWorkerVersion> waiting_version_; | 105 scoped_refptr<ServiceWorkerVersion> waiting_version_; |
| 102 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; | 106 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; |
| 103 base::WeakPtr<ServiceWorkerContextCore> context_; | 107 base::WeakPtr<ServiceWorkerContextCore> context_; |
| 104 ServiceWorkerDispatcherHost* dispatcher_host_; | 108 ServiceWorkerDispatcherHost* dispatcher_host_; |
| 105 | 109 |
| 106 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); | 110 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); |
| 107 }; | 111 }; |
| 108 | 112 |
| 109 } // namespace content | 113 } // namespace content |
| 110 | 114 |
| 111 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ | 115 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ |
| OLD | NEW |