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

Unified Diff: content/browser/renderer_host/render_message_filter.cc

Issue 20777009: A few more cleanups to the pepper code. Dispatch IPCs in the sockets implementations directly by ha… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_message_filter.cc
===================================================================
--- content/browser/renderer_host/render_message_filter.cc (revision 214423)
+++ content/browser/renderer_host/render_message_filter.cc (working copy)
@@ -442,6 +442,8 @@
if (message.type() == ViewHostMsg_GetAudioHardwareConfig::ID)
return audio_manager_->GetMessageLoop().get();
#endif
+ if (message.type() == ViewHostMsg_AsyncOpenFile::ID)
+ return BrowserThread::GetBlockingPool();
return NULL;
}
@@ -987,12 +989,9 @@
Send(reply_msg);
}
-void RenderMessageFilter::OnAsyncOpenFile(const IPC::Message& msg,
- const base::FilePath& path,
+void RenderMessageFilter::OnAsyncOpenFile(const base::FilePath& path,
int flags,
int message_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-
if (!ChildProcessSecurityPolicyImpl::GetInstance()->HasPermissionsForFile(
render_process_id_, path, flags)) {
DLOG(ERROR) << "Bad flags in ViewMsgHost_AsyncOpenFile message: " << flags;
@@ -1001,17 +1000,6 @@
return;
}
- BrowserThread::PostTask(
- BrowserThread::FILE, FROM_HERE, base::Bind(
- &RenderMessageFilter::AsyncOpenFileOnFileThread, this,
- path, flags, message_id, msg.routing_id()));
-}
-
-void RenderMessageFilter::AsyncOpenFileOnFileThread(const base::FilePath& path,
- int flags,
- int message_id,
- int routing_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
base::PlatformFileError error_code = base::PLATFORM_FILE_OK;
base::PlatformFile file = base::CreatePlatformFile(
path, flags, NULL, &error_code);
@@ -1020,11 +1008,7 @@
IPC::GetFileHandleForProcess(file, PeerHandle(), true) :
IPC::InvalidPlatformFileForTransit();
- IPC::Message* reply = new ViewMsg_AsyncOpenFile_ACK(
- routing_id, error_code, file_for_transit, message_id);
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(base::IgnoreResult(&RenderMessageFilter::Send), this, reply));
+ Send(new ViewMsg_AsyncOpenFile_ACK(error_code, file_for_transit, message_id));
}
void RenderMessageFilter::OnMediaLogEvents(

Powered by Google App Engine
This is Rietveld 408576698