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