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

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

Issue 277463003: Use a proper profile in NaClBrowserDelegateImpl::MapUrlToLocalFilePath (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 months 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_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
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, true /* use_blocking_api */,
121 nacl_host_message_filter->profile_directory(), &file_path)) {
121 NotifyRendererOfError(nacl_host_message_filter.get(), reply_msg); 122 NotifyRendererOfError(nacl_host_message_filter.get(), reply_msg);
122 return; 123 return;
123 } 124 }
124 125
125 base::File file = nacl::OpenNaClExecutableImpl(file_path); 126 base::File file = nacl::OpenNaClExecutableImpl(file_path);
126 if (file.IsValid()) { 127 if (file.IsValid()) {
127 // This function is running on the blocking pool, but the path needs to be 128 // This function is running on the blocking pool, but the path needs to be
128 // registered in a structure owned by the IO thread. 129 // registered in a structure owned by the IO thread.
129 BrowserThread::PostTask( 130 BrowserThread::PostTask(
130 BrowserThread::IO, FROM_HERE, 131 BrowserThread::IO, FROM_HERE,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 FROM_HERE, 229 FROM_HERE,
229 base::Bind( 230 base::Bind(
230 &DoOpenNaClExecutableOnThreadPool, 231 &DoOpenNaClExecutableOnThreadPool,
231 nacl_host_message_filter, 232 nacl_host_message_filter,
232 file_url, reply_msg))) { 233 file_url, reply_msg))) {
233 NotifyRendererOfError(nacl_host_message_filter.get(), reply_msg); 234 NotifyRendererOfError(nacl_host_message_filter.get(), reply_msg);
234 } 235 }
235 } 236 }
236 237
237 } // namespace nacl_file_host 238 } // namespace nacl_file_host
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698