| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_UTILITY_PROCESS_HOST_H_ | 5 #ifndef CHROME_BROWSER_UTILITY_PROCESS_HOST_H_ |
| 6 #define CHROME_BROWSER_UTILITY_PROCESS_HOST_H_ | 6 #define CHROME_BROWSER_UTILITY_PROCESS_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/ref_counted.h" | 13 #include "base/ref_counted.h" |
| 14 #include "base/task.h" | 14 #include "base/task.h" |
| 15 #include "chrome/browser/browser_child_process_host.h" | 15 #include "chrome/browser/browser_child_process_host.h" |
| 16 #include "chrome/browser/browser_thread.h" | 16 #include "chrome/browser/browser_thread.h" |
| 17 #include "chrome/common/extensions/update_manifest.h" | 17 #include "chrome/common/extensions/update_manifest.h" |
| 18 #include "ipc/ipc_channel.h" | |
| 19 | 18 |
| 20 class DictionaryValue; | 19 class DictionaryValue; |
| 21 class IndexedDBKey; | 20 class IndexedDBKey; |
| 22 class SerializedScriptValue; | 21 class SerializedScriptValue; |
| 23 class SkBitmap; | 22 class SkBitmap; |
| 24 | 23 |
| 25 // This class acts as the browser-side host to a utility child process. A | 24 // This class acts as the browser-side host to a utility child process. A |
| 26 // utility process is a short-lived sandboxed process that is created to run | 25 // utility process is a short-lived sandboxed process that is created to run |
| 27 // a specific task. This class lives solely on the IO thread. | 26 // a specific task. This class lives solely on the IO thread. |
| 28 // If you need a single method call in the sandbox, use StartFooBar(p). | 27 // If you need a single method call in the sandbox, use StartFooBar(p). |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // Starts a process if necessary. Returns true if it succeeded or a process | 147 // Starts a process if necessary. Returns true if it succeeded or a process |
| 149 // has already been started via StartBatchMode(). | 148 // has already been started via StartBatchMode(). |
| 150 bool StartProcess(const FilePath& exposed_dir); | 149 bool StartProcess(const FilePath& exposed_dir); |
| 151 | 150 |
| 152 // IPC messages: | 151 // IPC messages: |
| 153 virtual void OnMessageReceived(const IPC::Message& message); | 152 virtual void OnMessageReceived(const IPC::Message& message); |
| 154 | 153 |
| 155 // BrowserChildProcessHost: | 154 // BrowserChildProcessHost: |
| 156 virtual void OnProcessCrashed(int exit_code); | 155 virtual void OnProcessCrashed(int exit_code); |
| 157 virtual bool CanShutdown(); | 156 virtual bool CanShutdown(); |
| 158 virtual URLRequestContext* GetRequestContext( | |
| 159 uint32 request_id, | |
| 160 const ViewHostMsg_Resource_Request& request_data); | |
| 161 | 157 |
| 162 // A pointer to our client interface, who will be informed of progress. | 158 // A pointer to our client interface, who will be informed of progress. |
| 163 scoped_refptr<Client> client_; | 159 scoped_refptr<Client> client_; |
| 164 BrowserThread::ID client_thread_id_; | 160 BrowserThread::ID client_thread_id_; |
| 165 // True when running in batch mode, i.e., StartBatchMode() has been called | 161 // True when running in batch mode, i.e., StartBatchMode() has been called |
| 166 // and the utility process will run until EndBatchMode(). | 162 // and the utility process will run until EndBatchMode(). |
| 167 bool is_batch_mode_; | 163 bool is_batch_mode_; |
| 168 | 164 |
| 169 DISALLOW_COPY_AND_ASSIGN(UtilityProcessHost); | 165 DISALLOW_COPY_AND_ASSIGN(UtilityProcessHost); |
| 170 }; | 166 }; |
| 171 | 167 |
| 172 #endif // CHROME_BROWSER_UTILITY_PROCESS_HOST_H_ | 168 #endif // CHROME_BROWSER_UTILITY_PROCESS_HOST_H_ |
| OLD | NEW |