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_file_host.h" | 5 #include "components/nacl/browser/nacl_file_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 uint64 file_token_lo, | 42 uint64 file_token_lo, |
43 uint64 file_token_hi); | 43 uint64 file_token_hi); |
44 | 44 |
45 void DoRegisterOpenedNaClExecutableFile( | 45 void DoRegisterOpenedNaClExecutableFile( |
46 scoped_refptr<nacl::NaClHostMessageFilter> nacl_host_message_filter, | 46 scoped_refptr<nacl::NaClHostMessageFilter> nacl_host_message_filter, |
47 base::File file, | 47 base::File file, |
48 base::FilePath file_path, | 48 base::FilePath file_path, |
49 IPC::Message* reply_msg, | 49 IPC::Message* reply_msg, |
50 WriteFileInfoReply write_reply_message) { | 50 WriteFileInfoReply write_reply_message) { |
51 // IO thread owns the NaClBrowser singleton. | 51 // IO thread owns the NaClBrowser singleton. |
52 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 52 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
53 | 53 |
54 nacl::NaClBrowser* nacl_browser = nacl::NaClBrowser::GetInstance(); | 54 nacl::NaClBrowser* nacl_browser = nacl::NaClBrowser::GetInstance(); |
55 uint64 file_token_lo = 0; | 55 uint64 file_token_lo = 0; |
56 uint64 file_token_hi = 0; | 56 uint64 file_token_hi = 0; |
57 nacl_browser->PutFilePath(file_path, &file_token_lo, &file_token_hi); | 57 nacl_browser->PutFilePath(file_path, &file_token_lo, &file_token_hi); |
58 | 58 |
59 IPC::PlatformFileForTransit file_desc = IPC::TakeFileHandleForProcess( | 59 IPC::PlatformFileForTransit file_desc = IPC::TakeFileHandleForProcess( |
60 file.Pass(), | 60 file.Pass(), |
61 nacl_host_message_filter->PeerHandle()); | 61 nacl_host_message_filter->PeerHandle()); |
62 | 62 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 &DoOpenNaClExecutableOnThreadPool, | 268 &DoOpenNaClExecutableOnThreadPool, |
269 nacl_host_message_filter, | 269 nacl_host_message_filter, |
270 file_url, | 270 file_url, |
271 enable_validation_caching, | 271 enable_validation_caching, |
272 reply_msg))) { | 272 reply_msg))) { |
273 NotifyRendererOfError(nacl_host_message_filter.get(), reply_msg); | 273 NotifyRendererOfError(nacl_host_message_filter.get(), reply_msg); |
274 } | 274 } |
275 } | 275 } |
276 | 276 |
277 } // namespace nacl_file_host | 277 } // namespace nacl_file_host |
OLD | NEW |