| 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 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 } | 861 } |
| 862 | 862 |
| 863 void NaClProcessHost::OnSetKnownToValidate(const std::string& signature) { | 863 void NaClProcessHost::OnSetKnownToValidate(const std::string& signature) { |
| 864 NaClBrowser::GetInstance()->SetKnownToValidate( | 864 NaClBrowser::GetInstance()->SetKnownToValidate( |
| 865 signature, off_the_record_); | 865 signature, off_the_record_); |
| 866 } | 866 } |
| 867 | 867 |
| 868 void NaClProcessHost::FileResolved( | 868 void NaClProcessHost::FileResolved( |
| 869 const base::FilePath& file_path, | 869 const base::FilePath& file_path, |
| 870 IPC::Message* reply_msg, | 870 IPC::Message* reply_msg, |
| 871 const base::PlatformFile& file) { | 871 base::File file) { |
| 872 if (file != base::kInvalidPlatformFileValue) { | 872 if (file.IsValid()) { |
| 873 IPC::PlatformFileForTransit handle = IPC::GetFileHandleForProcess( | 873 IPC::PlatformFileForTransit handle = IPC::TakeFileHandleForProcess( |
| 874 file, | 874 file.Pass(), |
| 875 process_->GetData().handle, | 875 process_->GetData().handle); |
| 876 true /* close_source */); | |
| 877 NaClProcessMsg_ResolveFileToken::WriteReplyParams( | 876 NaClProcessMsg_ResolveFileToken::WriteReplyParams( |
| 878 reply_msg, | 877 reply_msg, |
| 879 handle, | 878 handle, |
| 880 file_path); | 879 file_path); |
| 881 } else { | 880 } else { |
| 882 NaClProcessMsg_ResolveFileToken::WriteReplyParams( | 881 NaClProcessMsg_ResolveFileToken::WriteReplyParams( |
| 883 reply_msg, | 882 reply_msg, |
| 884 IPC::InvalidPlatformFileForTransit(), | 883 IPC::InvalidPlatformFileForTransit(), |
| 885 base::FilePath()); | 884 base::FilePath()); |
| 886 } | 885 } |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 process_handle.Take(), info, | 1004 process_handle.Take(), info, |
| 1006 base::MessageLoopProxy::current(), | 1005 base::MessageLoopProxy::current(), |
| 1007 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, | 1006 base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker, |
| 1008 weak_factory_.GetWeakPtr())); | 1007 weak_factory_.GetWeakPtr())); |
| 1009 return true; | 1008 return true; |
| 1010 } | 1009 } |
| 1011 } | 1010 } |
| 1012 #endif | 1011 #endif |
| 1013 | 1012 |
| 1014 } // namespace nacl | 1013 } // namespace nacl |
| OLD | NEW |