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/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // This function is security sensitive. Be sure to check with a security | 110 // This function is security sensitive. Be sure to check with a security |
111 // person before you modify it. | 111 // person before you modify it. |
112 void DoOpenNaClExecutableOnThreadPool( | 112 void DoOpenNaClExecutableOnThreadPool( |
113 scoped_refptr<nacl::NaClHostMessageFilter> nacl_host_message_filter, | 113 scoped_refptr<nacl::NaClHostMessageFilter> nacl_host_message_filter, |
114 const GURL& file_url, | 114 const GURL& file_url, |
115 IPC::Message* reply_msg) { | 115 IPC::Message* reply_msg) { |
116 DCHECK(BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); | 116 DCHECK(BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); |
117 | 117 |
118 base::FilePath file_path; | 118 base::FilePath file_path; |
119 if (!nacl::NaClBrowser::GetDelegate()->MapUrlToLocalFilePath( | 119 if (!nacl::NaClBrowser::GetDelegate()->MapUrlToLocalFilePath( |
120 file_url, true /* use_blocking_api */, &file_path)) { | 120 file_url, |
| 121 true /* use_blocking_api */, |
| 122 nacl_host_message_filter->profile_directory(), |
| 123 &file_path)) { |
121 NotifyRendererOfError(nacl_host_message_filter.get(), reply_msg); | 124 NotifyRendererOfError(nacl_host_message_filter.get(), reply_msg); |
122 return; | 125 return; |
123 } | 126 } |
124 | 127 |
125 base::File file = nacl::OpenNaClExecutableImpl(file_path); | 128 base::File file = nacl::OpenNaClExecutableImpl(file_path); |
126 if (file.IsValid()) { | 129 if (file.IsValid()) { |
127 // This function is running on the blocking pool, but the path needs to be | 130 // This function is running on the blocking pool, but the path needs to be |
128 // registered in a structure owned by the IO thread. | 131 // registered in a structure owned by the IO thread. |
129 BrowserThread::PostTask( | 132 BrowserThread::PostTask( |
130 BrowserThread::IO, FROM_HERE, | 133 BrowserThread::IO, FROM_HERE, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 FROM_HERE, | 231 FROM_HERE, |
229 base::Bind( | 232 base::Bind( |
230 &DoOpenNaClExecutableOnThreadPool, | 233 &DoOpenNaClExecutableOnThreadPool, |
231 nacl_host_message_filter, | 234 nacl_host_message_filter, |
232 file_url, reply_msg))) { | 235 file_url, reply_msg))) { |
233 NotifyRendererOfError(nacl_host_message_filter.get(), reply_msg); | 236 NotifyRendererOfError(nacl_host_message_filter.get(), reply_msg); |
234 } | 237 } |
235 } | 238 } |
236 | 239 |
237 } // namespace nacl_file_host | 240 } // namespace nacl_file_host |
OLD | NEW |