| 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" | 
| 40 #include "content/public/browser/browser_child_process_host.h" | 41 #include "content/public/browser/browser_child_process_host.h" | 
| 41 #include "content/public/browser/browser_ppapi_host.h" | 42 #include "content/public/browser/browser_ppapi_host.h" | 
| 42 #include "content/public/browser/child_process_data.h" | 43 #include "content/public/browser/child_process_data.h" | 
| 43 #include "content/public/browser/plugin_service.h" | 44 #include "content/public/browser/plugin_service.h" | 
| 44 #include "content/public/browser/render_process_host.h" | 45 #include "content/public/browser/render_process_host.h" | 
| 45 #include "content/public/browser/web_contents.h" | 46 #include "content/public/browser/web_contents.h" | 
| 46 #include "content/public/common/child_process_host.h" | 47 #include "content/public/common/child_process_host.h" | 
| 47 #include "content/public/common/content_switches.h" | 48 #include "content/public/common/content_switches.h" | 
| 48 #include "content/public/common/process_type.h" | 49 #include "content/public/common/process_type.h" | 
| 49 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 50 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 
| 50 #include "ipc/ipc_channel.h" | 51 #include "ipc/ipc_channel.h" | 
| 51 #include "ipc/ipc_switches.h" | 52 #include "ipc/ipc_switches.h" | 
| 52 #include "native_client/src/shared/imc/nacl_imc_c.h" | 53 #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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 306       profile_directory_(profile_directory), | 306       profile_directory_(profile_directory), | 
| 307       render_view_id_(render_view_id), | 307       render_view_id_(render_view_id), | 
| 308       weak_factory_(this) { | 308       weak_factory_(this) { | 
| 309   process_.reset(content::BrowserChildProcessHost::Create( | 309   process_.reset(content::BrowserChildProcessHost::Create( | 
| 310       static_cast<content::ProcessType>(PROCESS_TYPE_NACL_LOADER), this)); | 310       static_cast<content::ProcessType>(PROCESS_TYPE_NACL_LOADER), this)); | 
| 311 | 311 | 
| 312   // Set the display name so the user knows what plugin the process is running. | 312   // Set the display name so the user knows what plugin the process is running. | 
| 313   // We aren't on the UI thread so getting the pref locale for language | 313   // We aren't on the UI thread so getting the pref locale for language | 
| 314   // formatting isn't possible, so IDN will be lost, but this is probably OK | 314   // formatting isn't possible, so IDN will be lost, but this is probably OK | 
| 315   // for this use case. | 315   // for this use case. | 
| 316   process_->SetName(net::FormatUrl(manifest_url_, std::string())); | 316   process_->SetName(url_formatter::FormatUrl(manifest_url_, std::string())); | 
| 317 | 317 | 
| 318   enable_debug_stub_ = base::CommandLine::ForCurrentProcess()->HasSwitch( | 318   enable_debug_stub_ = base::CommandLine::ForCurrentProcess()->HasSwitch( | 
| 319       switches::kEnableNaClDebug); | 319       switches::kEnableNaClDebug); | 
| 320   DCHECK(process_type_ != kUnknownNaClProcessType); | 320   DCHECK(process_type_ != kUnknownNaClProcessType); | 
| 321   enable_crash_throttling_ = process_type_ != kNativeNaClProcessType; | 321   enable_crash_throttling_ = process_type_ != kNativeNaClProcessType; | 
| 322 } | 322 } | 
| 323 | 323 | 
| 324 NaClProcessHost::~NaClProcessHost() { | 324 NaClProcessHost::~NaClProcessHost() { | 
| 325   // Report exit status only if the process was successfully started. | 325   // Report exit status only if the process was successfully started. | 
| 326   if (process_->GetData().handle != base::kNullProcessHandle) { | 326   if (process_->GetData().handle != base::kNullProcessHandle) { | 
| (...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1388     NaClStartDebugExceptionHandlerThread( | 1388     NaClStartDebugExceptionHandlerThread( | 
| 1389         process.Pass(), info, base::ThreadTaskRunnerHandle::Get(), | 1389         process.Pass(), info, base::ThreadTaskRunnerHandle::Get(), | 
| 1390         base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 1390         base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 
| 1391                    weak_factory_.GetWeakPtr())); | 1391                    weak_factory_.GetWeakPtr())); | 
| 1392     return true; | 1392     return true; | 
| 1393   } | 1393   } | 
| 1394 } | 1394 } | 
| 1395 #endif | 1395 #endif | 
| 1396 | 1396 | 
| 1397 }  // namespace nacl | 1397 }  // namespace nacl | 
| OLD | NEW | 
|---|