Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: components/nacl/browser/nacl_process_host.cc

Issue 100373005: Initial implementation of Bare Metal Mode for NaCl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 NaClStartParams params; 700 NaClStartParams params;
701 params.validation_cache_enabled = nacl_browser->ValidationCacheIsEnabled(); 701 params.validation_cache_enabled = nacl_browser->ValidationCacheIsEnabled();
702 params.validation_cache_key = nacl_browser->GetValidationCacheKey(); 702 params.validation_cache_key = nacl_browser->GetValidationCacheKey();
703 params.version = NaClBrowser::GetDelegate()->GetVersionString(); 703 params.version = NaClBrowser::GetDelegate()->GetVersionString();
704 params.enable_exception_handling = enable_exception_handling_; 704 params.enable_exception_handling = enable_exception_handling_;
705 params.enable_debug_stub = enable_debug_stub_ && 705 params.enable_debug_stub = enable_debug_stub_ &&
706 NaClBrowser::GetDelegate()->URLMatchesDebugPatterns(manifest_url_); 706 NaClBrowser::GetDelegate()->URLMatchesDebugPatterns(manifest_url_);
707 // Enable PPAPI proxy channel creation only for renderer processes. 707 // Enable PPAPI proxy channel creation only for renderer processes.
708 params.enable_ipc_proxy = enable_ppapi_proxy(); 708 params.enable_ipc_proxy = enable_ppapi_proxy();
709 params.uses_irt = uses_irt_; 709 params.uses_irt = uses_irt_;
710 params.enable_dyncode_syscalls = enable_dyncode_syscalls_; 710 params.enable_dyncode_syscalls = enable_dyncode_syscalls_;
Mark Seaborn 2013/12/10 19:56:44 The assignment to params.enable_nonsfi_mode should
hidehiko 2013/12/11 07:56:14 Done.
711 711
712 const ChildProcessData& data = process_->GetData(); 712 const ChildProcessData& data = process_->GetData();
713 if (!ShareHandleToSelLdr(data.handle, 713 if (!ShareHandleToSelLdr(data.handle,
714 internal_->socket_for_sel_ldr, true, 714 internal_->socket_for_sel_ldr, true,
715 &params.handles)) { 715 &params.handles)) {
716 return false; 716 return false;
717 } 717 }
718 718
719 if (params.uses_irt) { 719 if (params.uses_irt) {
720 base::PlatformFile irt_file = nacl_browser->IrtFile(); 720 base::PlatformFile irt_file = nacl_browser->IrtFile();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 net::SocketDescriptor server_bound_socket = GetDebugStubSocketHandle(); 752 net::SocketDescriptor server_bound_socket = GetDebugStubSocketHandle();
753 if (server_bound_socket != net::kInvalidSocket) { 753 if (server_bound_socket != net::kInvalidSocket) {
754 params.debug_stub_server_bound_socket = 754 params.debug_stub_server_bound_socket =
755 FileDescriptor(server_bound_socket, true); 755 FileDescriptor(server_bound_socket, true);
756 } 756 }
757 } 757 }
758 #endif 758 #endif
759 759
760 process_->Send(new NaClProcessMsg_Start(params)); 760 process_->Send(new NaClProcessMsg_Start(params));
761 761
762 params.enable_nonsfi_mode = CommandLine::ForCurrentProcess()->HasSwitch(
Mark Seaborn 2013/12/10 19:56:44 This is after the message has been sent, so it doe
hidehiko 2013/12/11 07:56:14 Oops... Done.
763 switches::kEnableNaClNonSfiMode);
764
762 internal_->socket_for_sel_ldr = NACL_INVALID_HANDLE; 765 internal_->socket_for_sel_ldr = NACL_INVALID_HANDLE;
763 return true; 766 return true;
764 } 767 }
765 768
766 bool NaClProcessHost::SendStart() { 769 bool NaClProcessHost::SendStart() {
767 if (!enable_ppapi_proxy()) { 770 if (!enable_ppapi_proxy()) {
768 if (!ReplyToRenderer(IPC::ChannelHandle())) 771 if (!ReplyToRenderer(IPC::ChannelHandle()))
769 return false; 772 return false;
770 } 773 }
771 return StartNaClExecution(); 774 return StartNaClExecution();
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698