| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "content/public/common/process_type.h" | 42 #include "content/public/common/process_type.h" |
| 43 #include "ipc/ipc_channel.h" | 43 #include "ipc/ipc_channel.h" |
| 44 #include "ipc/ipc_switches.h" | 44 #include "ipc/ipc_switches.h" |
| 45 #include "native_client/src/shared/imc/nacl_imc_c.h" | 45 #include "native_client/src/shared/imc/nacl_imc_c.h" |
| 46 #include "net/base/net_util.h" | 46 #include "net/base/net_util.h" |
| 47 #include "net/socket/tcp_listen_socket.h" | 47 #include "net/socket/tcp_listen_socket.h" |
| 48 #include "ppapi/host/host_factory.h" | 48 #include "ppapi/host/host_factory.h" |
| 49 #include "ppapi/host/ppapi_host.h" | 49 #include "ppapi/host/ppapi_host.h" |
| 50 #include "ppapi/proxy/ppapi_messages.h" | 50 #include "ppapi/proxy/ppapi_messages.h" |
| 51 #include "ppapi/shared_impl/ppapi_nacl_channel_args.h" | 51 #include "ppapi/shared_impl/ppapi_nacl_channel_args.h" |
| 52 #include "ppapi/shared_impl/ppapi_switches.h" |
| 52 | 53 |
| 53 #if defined(OS_POSIX) | 54 #if defined(OS_POSIX) |
| 54 #include <fcntl.h> | 55 #include <fcntl.h> |
| 55 | 56 |
| 56 #include "ipc/ipc_channel_posix.h" | 57 #include "ipc/ipc_channel_posix.h" |
| 57 #elif defined(OS_WIN) | 58 #elif defined(OS_WIN) |
| 58 #include <windows.h> | 59 #include <windows.h> |
| 59 | 60 |
| 60 #include "base/threading/thread.h" | 61 #include "base/threading/thread.h" |
| 61 #include "base/win/scoped_handle.h" | 62 #include "base/win/scoped_handle.h" |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 // Create the browser ppapi host and enable PPAPI message dispatching to the | 793 // Create the browser ppapi host and enable PPAPI message dispatching to the |
| 793 // browser process. | 794 // browser process. |
| 794 ppapi_host_.reset(content::BrowserPpapiHost::CreateExternalPluginProcess( | 795 ppapi_host_.reset(content::BrowserPpapiHost::CreateExternalPluginProcess( |
| 795 ipc_proxy_channel_.get(), // sender | 796 ipc_proxy_channel_.get(), // sender |
| 796 permissions_, | 797 permissions_, |
| 797 process_->GetData().handle, | 798 process_->GetData().handle, |
| 798 ipc_proxy_channel_.get(), | 799 ipc_proxy_channel_.get(), |
| 799 nacl_host_message_filter_->render_process_id(), | 800 nacl_host_message_filter_->render_process_id(), |
| 800 render_view_id_, | 801 render_view_id_, |
| 801 profile_directory_)); | 802 profile_directory_)); |
| 803 ppapi_host_->SetOnKeepaliveCallback( |
| 804 NaClBrowser::GetDelegate()->GetOnKeepaliveCallback()); |
| 802 | 805 |
| 803 ppapi::PpapiNaClChannelArgs args; | 806 ppapi::PpapiNaClChannelArgs args; |
| 804 args.off_the_record = nacl_host_message_filter_->off_the_record(); | 807 args.off_the_record = nacl_host_message_filter_->off_the_record(); |
| 805 args.permissions = permissions_; | 808 args.permissions = permissions_; |
| 806 args.supports_dev_channel = | 809 args.supports_dev_channel = |
| 807 content::PluginService::GetInstance()->PpapiDevChannelSupported(); | 810 content::PluginService::GetInstance()->PpapiDevChannelSupported(); |
| 808 CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 811 CommandLine* cmdline = CommandLine::ForCurrentProcess(); |
| 809 DCHECK(cmdline); | 812 DCHECK(cmdline); |
| 810 std::string flag_whitelist[] = {switches::kV, switches::kVModule}; | 813 std::string flag_whitelist[] = {switches::kV, switches::kVModule}; |
| 811 for (size_t i = 0; i < arraysize(flag_whitelist); ++i) { | 814 for (size_t i = 0; i < arraysize(flag_whitelist); ++i) { |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 process_handle.Take(), info, | 1021 process_handle.Take(), info, |
| 1019 base::MessageLoopProxy::current(), | 1022 base::MessageLoopProxy::current(), |
| 1020 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 1023 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
| 1021 weak_factory_.GetWeakPtr())); | 1024 weak_factory_.GetWeakPtr())); |
| 1022 return true; | 1025 return true; |
| 1023 } | 1026 } |
| 1024 } | 1027 } |
| 1025 #endif | 1028 #endif |
| 1026 | 1029 |
| 1027 } // namespace nacl | 1030 } // namespace nacl |
| OLD | NEW |