| 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 "components/nacl/browser/nacl_process_host.h" | 5 #include "components/nacl/browser/nacl_process_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "base/win/windows_version.h" | 30 #include "base/win/windows_version.h" |
| 31 #include "build/build_config.h" | 31 #include "build/build_config.h" |
| 32 #include "components/nacl/browser/nacl_browser.h" | 32 #include "components/nacl/browser/nacl_browser.h" |
| 33 #include "components/nacl/browser/nacl_browser_delegate.h" | 33 #include "components/nacl/browser/nacl_browser_delegate.h" |
| 34 #include "components/nacl/browser/nacl_host_message_filter.h" | 34 #include "components/nacl/browser/nacl_host_message_filter.h" |
| 35 #include "components/nacl/common/nacl_cmd_line.h" | 35 #include "components/nacl/common/nacl_cmd_line.h" |
| 36 #include "components/nacl/common/nacl_host_messages.h" | 36 #include "components/nacl/common/nacl_host_messages.h" |
| 37 #include "components/nacl/common/nacl_messages.h" | 37 #include "components/nacl/common/nacl_messages.h" |
| 38 #include "components/nacl/common/nacl_process_type.h" | 38 #include "components/nacl/common/nacl_process_type.h" |
| 39 #include "components/nacl/common/nacl_switches.h" | 39 #include "components/nacl/common/nacl_switches.h" |
| 40 #include "components/url_formatter/url_formatter.h" | |
| 41 #include "content/public/browser/browser_child_process_host.h" | 40 #include "content/public/browser/browser_child_process_host.h" |
| 42 #include "content/public/browser/browser_ppapi_host.h" | 41 #include "content/public/browser/browser_ppapi_host.h" |
| 43 #include "content/public/browser/child_process_data.h" | 42 #include "content/public/browser/child_process_data.h" |
| 44 #include "content/public/browser/plugin_service.h" | 43 #include "content/public/browser/plugin_service.h" |
| 45 #include "content/public/browser/render_process_host.h" | 44 #include "content/public/browser/render_process_host.h" |
| 46 #include "content/public/browser/web_contents.h" | 45 #include "content/public/browser/web_contents.h" |
| 47 #include "content/public/common/child_process_host.h" | 46 #include "content/public/common/child_process_host.h" |
| 48 #include "content/public/common/content_switches.h" | 47 #include "content/public/common/content_switches.h" |
| 49 #include "content/public/common/process_type.h" | 48 #include "content/public/common/process_type.h" |
| 50 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 49 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
| 51 #include "ipc/ipc_channel.h" | 50 #include "ipc/ipc_channel.h" |
| 52 #include "ipc/ipc_switches.h" | 51 #include "ipc/ipc_switches.h" |
| 53 #include "native_client/src/shared/imc/nacl_imc_c.h" | 52 #include "native_client/src/shared/imc/nacl_imc_c.h" |
| 53 #include "net/base/net_util.h" |
| 54 #include "net/socket/socket_descriptor.h" | 54 #include "net/socket/socket_descriptor.h" |
| 55 #include "ppapi/host/host_factory.h" | 55 #include "ppapi/host/host_factory.h" |
| 56 #include "ppapi/host/ppapi_host.h" | 56 #include "ppapi/host/ppapi_host.h" |
| 57 #include "ppapi/proxy/ppapi_messages.h" | 57 #include "ppapi/proxy/ppapi_messages.h" |
| 58 #include "ppapi/shared_impl/ppapi_constants.h" | 58 #include "ppapi/shared_impl/ppapi_constants.h" |
| 59 #include "ppapi/shared_impl/ppapi_nacl_plugin_args.h" | 59 #include "ppapi/shared_impl/ppapi_nacl_plugin_args.h" |
| 60 | 60 |
| 61 #if defined(OS_POSIX) | 61 #if defined(OS_POSIX) |
| 62 | 62 |
| 63 #include <fcntl.h> | 63 #include <fcntl.h> |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 profile_directory_(profile_directory), | 303 profile_directory_(profile_directory), |
| 304 render_view_id_(render_view_id), | 304 render_view_id_(render_view_id), |
| 305 weak_factory_(this) { | 305 weak_factory_(this) { |
| 306 process_.reset(content::BrowserChildProcessHost::Create( | 306 process_.reset(content::BrowserChildProcessHost::Create( |
| 307 static_cast<content::ProcessType>(PROCESS_TYPE_NACL_LOADER), this)); | 307 static_cast<content::ProcessType>(PROCESS_TYPE_NACL_LOADER), this)); |
| 308 | 308 |
| 309 // Set the display name so the user knows what plugin the process is running. | 309 // Set the display name so the user knows what plugin the process is running. |
| 310 // We aren't on the UI thread so getting the pref locale for language | 310 // We aren't on the UI thread so getting the pref locale for language |
| 311 // formatting isn't possible, so IDN will be lost, but this is probably OK | 311 // formatting isn't possible, so IDN will be lost, but this is probably OK |
| 312 // for this use case. | 312 // for this use case. |
| 313 process_->SetName(url_formatter::FormatUrl(manifest_url_, std::string())); | 313 process_->SetName(net::FormatUrl(manifest_url_, std::string())); |
| 314 | 314 |
| 315 enable_debug_stub_ = base::CommandLine::ForCurrentProcess()->HasSwitch( | 315 enable_debug_stub_ = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 316 switches::kEnableNaClDebug); | 316 switches::kEnableNaClDebug); |
| 317 DCHECK(process_type_ != kUnknownNaClProcessType); | 317 DCHECK(process_type_ != kUnknownNaClProcessType); |
| 318 enable_crash_throttling_ = process_type_ != kNativeNaClProcessType; | 318 enable_crash_throttling_ = process_type_ != kNativeNaClProcessType; |
| 319 } | 319 } |
| 320 | 320 |
| 321 NaClProcessHost::~NaClProcessHost() { | 321 NaClProcessHost::~NaClProcessHost() { |
| 322 // Report exit status only if the process was successfully started. | 322 // Report exit status only if the process was successfully started. |
| 323 if (process_->GetData().handle != base::kNullProcessHandle) { | 323 if (process_->GetData().handle != base::kNullProcessHandle) { |
| (...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1385 NaClStartDebugExceptionHandlerThread( | 1385 NaClStartDebugExceptionHandlerThread( |
| 1386 process.Pass(), info, base::ThreadTaskRunnerHandle::Get(), | 1386 process.Pass(), info, base::ThreadTaskRunnerHandle::Get(), |
| 1387 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 1387 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
| 1388 weak_factory_.GetWeakPtr())); | 1388 weak_factory_.GetWeakPtr())); |
| 1389 return true; | 1389 return true; |
| 1390 } | 1390 } |
| 1391 } | 1391 } |
| 1392 #endif | 1392 #endif |
| 1393 | 1393 |
| 1394 } // namespace nacl | 1394 } // namespace nacl |
| OLD | NEW |