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

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: fix browsertest Created 7 years, 4 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
« no previous file with comments | « content/browser/renderer_host/render_message_filter.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_message_filter.cc
===================================================================
--- content/browser/renderer_host/render_message_filter.cc (revision 215615)
+++ content/browser/renderer_host/render_message_filter.cc (working copy)
@@ -444,6 +444,8 @@
if (message.type() == ViewHostMsg_GetAudioHardwareConfig::ID)
return audio_manager_->GetMessageLoop().get();
#endif
+ if (message.type() == ViewHostMsg_AsyncOpenPepperFile::ID)
+ return BrowserThread::GetBlockingPool();
return NULL;
}
@@ -989,12 +991,10 @@
Send(reply_msg);
}
-void RenderMessageFilter::OnAsyncOpenPepperFile(const IPC::Message& msg,
+void RenderMessageFilter::OnAsyncOpenPepperFile(int routing_id,
const base::FilePath& path,
int pp_open_flags,
int message_id) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-
int platform_file_flags = 0;
if (!CanOpenWithPepperFlags(pp_open_flags, render_process_id_, path) ||
!ppapi::PepperFileOpenFlagsToPlatformFileFlags(
@@ -1007,18 +1007,6 @@
return;
}
- BrowserThread::PostTask(
- BrowserThread::FILE, FROM_HERE, base::Bind(
- &RenderMessageFilter::AsyncOpenPepperFileOnFileThread, this,
- path, platform_file_flags, message_id, msg.routing_id()));
-}
-
-void RenderMessageFilter::AsyncOpenPepperFileOnFileThread(
- const base::FilePath& path,
- int platform_file_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, platform_file_flags, NULL, &error_code);
@@ -1027,14 +1015,8 @@
IPC::GetFileHandleForProcess(file, PeerHandle(), true) :
IPC::InvalidPlatformFileForTransit();
- IPC::Message* reply = new ViewMsg_AsyncOpenPepperFile_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_AsyncOpenPepperFile_ACK(
+ routing_id, error_code, file_for_transit, message_id));
}
void RenderMessageFilter::OnMediaLogEvents(
« no previous file with comments | « content/browser/renderer_host/render_message_filter.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698