| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ | 5 #ifndef CHROME_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ |
| 6 #define CHROME_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ | 6 #define CHROME_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/file_path.h" |
| 13 #include "base/ref_counted.h" | 14 #include "base/ref_counted.h" |
| 14 #include "chrome/browser/browser_child_process_host.h" | 15 #include "chrome/browser/browser_child_process_host.h" |
| 15 #include "chrome/browser/net/chrome_url_request_context.h" | 16 #include "chrome/browser/net/chrome_url_request_context.h" |
| 16 #include "chrome/browser/worker_host/worker_document_set.h" | 17 #include "chrome/browser/worker_host/worker_document_set.h" |
| 17 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
| 18 #include "ipc/ipc_channel.h" | 19 #include "ipc/ipc_channel.h" |
| 19 | 20 |
| 20 class AppCacheDispatcherHost; | 21 class AppCacheDispatcherHost; |
| 21 class BlobDispatcherHost; | 22 class BlobDispatcherHost; |
| 22 class ChromeURLRequestContext; | 23 class ChromeURLRequestContext; |
| 23 class ChromeURLRequestContextGetter; | 24 class ChromeURLRequestContextGetter; |
| 24 class DatabaseDispatcherHost; | 25 class DatabaseDispatcherHost; |
| 25 class FileSystemDispatcherHost; | 26 class FileSystemDispatcherHost; |
| 27 class FileUtilitiesDispatcherHost; |
| 26 namespace webkit_database { | 28 namespace webkit_database { |
| 27 class DatabaseTracker; | 29 class DatabaseTracker; |
| 28 } // namespace webkit_database | 30 } // namespace webkit_database |
| 29 | 31 |
| 30 struct ViewHostMsg_CreateWorker_Params; | 32 struct ViewHostMsg_CreateWorker_Params; |
| 31 | 33 |
| 32 // The WorkerProcessHost is the interface that represents the browser side of | 34 // The WorkerProcessHost is the interface that represents the browser side of |
| 33 // the browser <-> worker communication channel. There will be one | 35 // the browser <-> worker communication channel. There will be one |
| 34 // WorkerProcessHost per worker process. Currently each worker runs in its own | 36 // WorkerProcessHost per worker process. Currently each worker runs in its own |
| 35 // process, but that may change. However, we do assume [by storing a | 37 // process, but that may change. However, we do assume [by storing a |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 virtual bool CanShutdown() { return instances_.empty(); } | 187 virtual bool CanShutdown() { return instances_.empty(); } |
| 186 | 188 |
| 187 // Updates the title shown in the task manager. | 189 // Updates the title shown in the task manager. |
| 188 void UpdateTitle(); | 190 void UpdateTitle(); |
| 189 | 191 |
| 190 void OnCreateWorker(const ViewHostMsg_CreateWorker_Params& params, | 192 void OnCreateWorker(const ViewHostMsg_CreateWorker_Params& params, |
| 191 int* route_id); | 193 int* route_id); |
| 192 void OnCancelCreateDedicatedWorker(int route_id); | 194 void OnCancelCreateDedicatedWorker(int route_id); |
| 193 void OnForwardToWorker(const IPC::Message& message); | 195 void OnForwardToWorker(const IPC::Message& message); |
| 194 | 196 |
| 197 void OnGetMimeTypeFromExtension( |
| 198 const FilePath::StringType& ext, std::string* mime_type); |
| 199 void OnGetMimeTypeFromFile( |
| 200 const FilePath& file_path, std::string* mime_type); |
| 201 void OnGetPreferredExtensionForMimeType( |
| 202 const std::string& mime_type, FilePath::StringType* ext); |
| 203 |
| 195 Instances instances_; | 204 Instances instances_; |
| 196 | 205 |
| 197 scoped_refptr<ChromeURLRequestContext> request_context_; | 206 scoped_refptr<ChromeURLRequestContext> request_context_; |
| 198 scoped_ptr<AppCacheDispatcherHost> appcache_dispatcher_host_; | 207 scoped_ptr<AppCacheDispatcherHost> appcache_dispatcher_host_; |
| 199 scoped_refptr<DatabaseDispatcherHost> db_dispatcher_host_; | 208 scoped_refptr<DatabaseDispatcherHost> db_dispatcher_host_; |
| 200 scoped_ptr<BlobDispatcherHost> blob_dispatcher_host_; | 209 scoped_ptr<BlobDispatcherHost> blob_dispatcher_host_; |
| 201 scoped_refptr<FileSystemDispatcherHost> file_system_dispatcher_host_; | 210 scoped_refptr<FileSystemDispatcherHost> file_system_dispatcher_host_; |
| 211 scoped_refptr<FileUtilitiesDispatcherHost> file_utilities_dispatcher_host_; |
| 202 | 212 |
| 203 // A callback to create a routing id for the associated worker process. | 213 // A callback to create a routing id for the associated worker process. |
| 204 scoped_ptr<CallbackWithReturnValue<int>::Type> next_route_id_callback_; | 214 scoped_ptr<CallbackWithReturnValue<int>::Type> next_route_id_callback_; |
| 205 | 215 |
| 206 DISALLOW_COPY_AND_ASSIGN(WorkerProcessHost); | 216 DISALLOW_COPY_AND_ASSIGN(WorkerProcessHost); |
| 207 }; | 217 }; |
| 208 | 218 |
| 209 #endif // CHROME_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ | 219 #endif // CHROME_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ |
| OLD | NEW |