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

Unified Diff: chrome/browser/nacl_host/nacl_host_message_filter.cc

Issue 19863003: PNaCl on-demand installs: Make a separate async IPC to check if PNaCl is installed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const ref 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: chrome/browser/nacl_host/nacl_host_message_filter.cc
diff --git a/chrome/browser/nacl_host/nacl_host_message_filter.cc b/chrome/browser/nacl_host/nacl_host_message_filter.cc
index ceecc2a5b840a4c5a093500b9b8e312706df0aa8..d4ae71fe8e2da886e4e5e28b03c0e44dc1783b44 100644
--- a/chrome/browser/nacl_host/nacl_host_message_filter.cc
+++ b/chrome/browser/nacl_host/nacl_host_message_filter.cc
@@ -56,6 +56,8 @@ bool NaClHostMessageFilter::OnMessageReceived(const IPC::Message& message,
IPC_BEGIN_MESSAGE_MAP_EX(NaClHostMessageFilter, message, *message_was_ok)
#if !defined(DISABLE_NACL)
IPC_MESSAGE_HANDLER_DELAY_REPLY(NaClHostMsg_LaunchNaCl, OnLaunchNaCl)
+ IPC_MESSAGE_HANDLER(NaClHostMsg_EnsurePnaclInstalled,
+ OnEnsurePnaclInstalled)
IPC_MESSAGE_HANDLER_DELAY_REPLY(NaClHostMsg_GetReadonlyPnaclFD,
OnGetReadonlyPnaclFd)
IPC_MESSAGE_HANDLER_DELAY_REPLY(NaClHostMsg_NaClCreateTemporaryFile,
@@ -96,6 +98,30 @@ void NaClHostMessageFilter::OnLaunchNaCl(
host->Launch(this, reply_msg, manifest_url);
}
+void NaClHostMessageFilter::ReplyEnsurePnaclInstalled(
+ int instance,
+ bool success) {
+ Send(new NaClViewMsg_EnsurePnaclInstalledReply(instance, success));
+}
+
+void NaClHostMessageFilter::SendProgressEnsurePnaclInstalled(
+ int instance,
+ int64_t current_progress,
+ int64_t total) {
+ Send(new NaClViewMsg_EnsurePnaclInstalledProgress(instance,
+ current_progress,
+ total));
+}
+
+void NaClHostMessageFilter::OnEnsurePnaclInstalled(
+ int instance) {
+ nacl_file_host::EnsurePnaclInstalled(
+ base::Bind(&NaClHostMessageFilter::ReplyEnsurePnaclInstalled,
+ this, instance),
+ base::Bind(&NaClHostMessageFilter::SendProgressEnsurePnaclInstalled,
+ this, instance));
+}
+
void NaClHostMessageFilter::OnGetReadonlyPnaclFd(
const std::string& filename, IPC::Message* reply_msg) {
// This posts a task to another thread, but the renderer will

Powered by Google App Engine
This is Rietveld 408576698