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

Unified Diff: chrome/renderer/pepper/pnacl_translation_resource_host.h

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: int64_t to int64 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/renderer/pepper/pnacl_translation_resource_host.h
diff --git a/chrome/renderer/pepper/pnacl_translation_resource_host.h b/chrome/renderer/pepper/pnacl_translation_resource_host.h
index 271b27d6b113013d8423e53166de1ee72e18f751..54b6bd548791ac6d90bec4ecd21cf8bb0a99f8c2 100644
--- a/chrome/renderer/pepper/pnacl_translation_resource_host.h
+++ b/chrome/renderer/pepper/pnacl_translation_resource_host.h
@@ -7,6 +7,7 @@
#include <map>
+#include "base/basictypes.h"
#include "components/nacl/common/pnacl_types.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_platform_file.h"
@@ -31,6 +32,10 @@ class PnaclTranslationResourceHost : public IPC::ChannelProxy::MessageFilter {
scoped_refptr<ppapi::TrackedCallback> callback);
void ReportTranslationFinished(PP_Instance instance);
+ // Ensure that PNaCl resources (pnacl-llc.nexe, linker, libs) are installed.
+ void EnsurePnaclInstalled(PP_Instance instance,
+ scoped_refptr<ppapi::TrackedCallback> callback);
+
protected:
virtual ~PnaclTranslationResourceHost();
@@ -51,6 +56,9 @@ class PnaclTranslationResourceHost : public IPC::ChannelProxy::MessageFilter {
// Maps the instance with an outstanding cache request to the info
// about that request.
typedef std::map<PP_Instance, CacheRequestInfo> CacheRequestInfoMap;
+ // Maps the instance to an outstanding ensure pnacl installed request.
dmichael (off chromium) 2013/08/01 17:33:49 s/ensure pnacl installed/EnsurePnaclInstalled migh
jvoung (off chromium) 2013/08/01 23:14:07 Done.
+ typedef std::map<PP_Instance, scoped_refptr<ppapi::TrackedCallback> >
+ EnsurePnaclInstalledMap;
dmichael (off chromium) 2013/08/01 17:37:00 By the way... what happens if a particular plugin
jvoung (off chromium) 2013/08/01 23:14:07 It could actually happen, if you load multiple PNa
// IPC::ChannelProxy::MessageFilter implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE;
@@ -61,12 +69,19 @@ class PnaclTranslationResourceHost : public IPC::ChannelProxy::MessageFilter {
bool is_hit,
IPC::PlatformFileForTransit file);
void CleanupCacheRequests();
+ void OnEnsurePnaclInstalledReply(PP_Instance instance,
+ bool success);
+ void OnEnsurePnaclInstalledProgress(PP_Instance instance,
+ int64 current_progress,
+ int64 total);
+ void CleanupEnsurePnaclRequests();
scoped_refptr<base::MessageLoopProxy> io_message_loop_;
IPC::Channel* channel_;
dmichael (off chromium) 2013/08/01 17:33:49 ^^^ it looks like channel_ should also only be acc
jvoung (off chromium) 2013/08/01 23:14:07 Yes, I'll put it under the comment as well.
// Should be accessed on the io thread.
CacheRequestInfoMap pending_cache_requests_;
+ EnsurePnaclInstalledMap pending_ensure_pnacl_requests_;
DISALLOW_COPY_AND_ASSIGN(PnaclTranslationResourceHost);
};

Powered by Google App Engine
This is Rietveld 408576698