| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/plugin_loader_posix.h" | 5 #include "content/browser/plugin_loader_posix.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } | 134 } |
| 135 | 135 |
| 136 RecordAction( | 136 RecordAction( |
| 137 base::UserMetricsAction("PluginLoaderPosix.LaunchUtilityProcess")); | 137 base::UserMetricsAction("PluginLoaderPosix.LaunchUtilityProcess")); |
| 138 | 138 |
| 139 UtilityProcessHostImpl* host = new UtilityProcessHostImpl( | 139 UtilityProcessHostImpl* host = new UtilityProcessHostImpl( |
| 140 this, | 140 this, |
| 141 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get()); | 141 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get()); |
| 142 process_host_ = host->AsWeakPtr(); | 142 process_host_ = host->AsWeakPtr(); |
| 143 process_host_->DisableSandbox(); | 143 process_host_->DisableSandbox(); |
| 144 #if defined(OS_MACOSX) | |
| 145 host->set_child_flags(ChildProcessHost::CHILD_ALLOW_HEAP_EXECUTION); | |
| 146 #endif | |
| 147 | 144 |
| 148 bool launched = LaunchUtilityProcess(); | 145 bool launched = LaunchUtilityProcess(); |
| 149 if (!launched) { | 146 if (!launched) { |
| 150 // The utility process either failed to start or failed to receive the IPC. | 147 // The utility process either failed to start or failed to receive the IPC. |
| 151 // This process will never receive any callbacks for OnPluginLoaded() or | 148 // This process will never receive any callbacks for OnPluginLoaded() or |
| 152 // OnPluginLoadFailed(). | 149 // OnPluginLoadFailed(). |
| 153 FinishedLoadingPlugins(); | 150 FinishedLoadingPlugins(); |
| 154 } | 151 } |
| 155 } | 152 } |
| 156 | 153 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 FROM_HERE, base::Bind(callback, loaded_plugins_)); | 228 FROM_HERE, base::Bind(callback, loaded_plugins_)); |
| 232 } | 229 } |
| 233 callbacks_.clear(); | 230 callbacks_.clear(); |
| 234 } | 231 } |
| 235 | 232 |
| 236 bool PluginLoaderPosix::LaunchUtilityProcess() { | 233 bool PluginLoaderPosix::LaunchUtilityProcess() { |
| 237 return process_host_->Send(new UtilityMsg_LoadPlugins(canonical_list_)); | 234 return process_host_->Send(new UtilityMsg_LoadPlugins(canonical_list_)); |
| 238 } | 235 } |
| 239 | 236 |
| 240 } // namespace content | 237 } // namespace content |
| OLD | NEW |