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 #include "content/browser/utility_process_host.h" | 5 #include "content/browser/utility_process_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "content/browser/browser_child_process_host.h" | 12 #include "content/browser/browser_child_process_host_impl.h" |
13 #include "content/common/child_process_host_impl.h" | 13 #include "content/common/child_process_host_impl.h" |
14 #include "content/common/utility_messages.h" | 14 #include "content/common/utility_messages.h" |
15 #include "content/public/browser/content_browser_client.h" | 15 #include "content/public/browser/content_browser_client.h" |
16 #include "content/public/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
17 #include "ipc/ipc_switches.h" | 17 #include "ipc/ipc_switches.h" |
18 #include "ui/base/ui_base_switches.h" | 18 #include "ui/base/ui_base_switches.h" |
19 #include "webkit/plugins/plugin_switches.h" | 19 #include "webkit/plugins/plugin_switches.h" |
20 | 20 |
21 using content::BrowserThread; | 21 using content::BrowserThread; |
22 using content::ChildProcessHost; | 22 using content::ChildProcessHost; |
(...skipping 18 matching lines...) Expand all Loading... |
41 client_thread_id_(client_thread_id), | 41 client_thread_id_(client_thread_id), |
42 is_batch_mode_(false), | 42 is_batch_mode_(false), |
43 no_sandbox_(false), | 43 no_sandbox_(false), |
44 #if defined(OS_LINUX) | 44 #if defined(OS_LINUX) |
45 child_flags_(ChildProcessHost::CHILD_ALLOW_SELF), | 45 child_flags_(ChildProcessHost::CHILD_ALLOW_SELF), |
46 #else | 46 #else |
47 child_flags_(ChildProcessHost::CHILD_NORMAL), | 47 child_flags_(ChildProcessHost::CHILD_NORMAL), |
48 #endif | 48 #endif |
49 use_linux_zygote_(false), | 49 use_linux_zygote_(false), |
50 started_(false) { | 50 started_(false) { |
51 process_.reset(new BrowserChildProcessHost( | 51 process_.reset( |
52 content::PROCESS_TYPE_UTILITY, this)); | 52 new BrowserChildProcessHostImpl(content::PROCESS_TYPE_UTILITY, this)); |
53 } | 53 } |
54 | 54 |
55 UtilityProcessHost::~UtilityProcessHost() { | 55 UtilityProcessHost::~UtilityProcessHost() { |
56 DCHECK(!is_batch_mode_); | 56 DCHECK(!is_batch_mode_); |
57 } | 57 } |
58 | 58 |
59 bool UtilityProcessHost::Send(IPC::Message* message) { | 59 bool UtilityProcessHost::Send(IPC::Message* message) { |
60 if (!StartProcess()) | 60 if (!StartProcess()) |
61 return false; | 61 return false; |
62 | 62 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 base::Bind(base::IgnoreResult(&Client::OnMessageReceived), | 156 base::Bind(base::IgnoreResult(&Client::OnMessageReceived), |
157 client_.get(), message)); | 157 client_.get(), message)); |
158 return true; | 158 return true; |
159 } | 159 } |
160 | 160 |
161 void UtilityProcessHost::OnProcessCrashed(int exit_code) { | 161 void UtilityProcessHost::OnProcessCrashed(int exit_code) { |
162 BrowserThread::PostTask( | 162 BrowserThread::PostTask( |
163 client_thread_id_, FROM_HERE, | 163 client_thread_id_, FROM_HERE, |
164 base::Bind(&Client::OnProcessCrashed, client_.get(), exit_code)); | 164 base::Bind(&Client::OnProcessCrashed, client_.get(), exit_code)); |
165 } | 165 } |
OLD | NEW |