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

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: git cl format 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,
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
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
OLDNEW
« no previous file with comments | « components/nacl/browser/nacl_browser_delegate.h ('k') | components/nacl/browser/nacl_host_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698