| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WORKER_HOST_WORKER_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ |
| 6 #define CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
| 14 #include "content/browser/browser_child_process_host.h" | 14 #include "content/browser/browser_child_process_host.h" |
| 15 #include "content/common/content_export.h" |
| 15 #include "content/browser/worker_host/worker_document_set.h" | 16 #include "content/browser/worker_host/worker_document_set.h" |
| 16 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 17 | 18 |
| 18 class ResourceDispatcherHost; | 19 class ResourceDispatcherHost; |
| 19 | 20 |
| 20 namespace content { | 21 namespace content { |
| 21 class ResourceContext; | 22 class ResourceContext; |
| 22 } // namespace content | 23 } // namespace content |
| 23 | 24 |
| 24 // The WorkerProcessHost is the interface that represents the browser side of | 25 // The WorkerProcessHost is the interface that represents the browser side of |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 bool FilterMessage(const IPC::Message& message, WorkerMessageFilter* filter); | 126 bool FilterMessage(const IPC::Message& message, WorkerMessageFilter* filter); |
| 126 | 127 |
| 127 void FilterShutdown(WorkerMessageFilter* filter); | 128 void FilterShutdown(WorkerMessageFilter* filter); |
| 128 | 129 |
| 129 // Shuts down any shared workers that are no longer referenced by active | 130 // Shuts down any shared workers that are no longer referenced by active |
| 130 // documents. | 131 // documents. |
| 131 void DocumentDetached(WorkerMessageFilter* filter, | 132 void DocumentDetached(WorkerMessageFilter* filter, |
| 132 unsigned long long document_id); | 133 unsigned long long document_id); |
| 133 | 134 |
| 134 // Terminates the given worker, i.e. based on a UI action. | 135 // Terminates the given worker, i.e. based on a UI action. |
| 135 void TerminateWorker(int worker_route_id); | 136 CONTENT_EXPORT void TerminateWorker(int worker_route_id); |
| 136 | 137 |
| 137 typedef std::list<WorkerInstance> Instances; | 138 typedef std::list<WorkerInstance> Instances; |
| 138 const Instances& instances() const { return instances_; } | 139 const Instances& instances() const { return instances_; } |
| 139 | 140 |
| 140 const content::ResourceContext* resource_context() const { | 141 const content::ResourceContext* resource_context() const { |
| 141 return resource_context_; | 142 return resource_context_; |
| 142 } | 143 } |
| 143 | 144 |
| 144 protected: | 145 protected: |
| 145 friend class WorkerService; | 146 friend class WorkerService; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // keep this around since we'll use it when forward messages to the worker | 188 // keep this around since we'll use it when forward messages to the worker |
| 188 // process. | 189 // process. |
| 189 scoped_refptr<WorkerMessageFilter> worker_message_filter_; | 190 scoped_refptr<WorkerMessageFilter> worker_message_filter_; |
| 190 | 191 |
| 191 ResourceDispatcherHost* const resource_dispatcher_host_; | 192 ResourceDispatcherHost* const resource_dispatcher_host_; |
| 192 | 193 |
| 193 DISALLOW_COPY_AND_ASSIGN(WorkerProcessHost); | 194 DISALLOW_COPY_AND_ASSIGN(WorkerProcessHost); |
| 194 }; | 195 }; |
| 195 | 196 |
| 196 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ | 197 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ |
| OLD | NEW |