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

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: 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/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 41edcbf2d1d47cff4f7f0633e9738e31d1c419da..0ffe9231f22df4472b0a24b5c251b218bab1bed8 100644
--- a/chrome/renderer/pepper/pnacl_translation_resource_host.h
+++ b/chrome/renderer/pepper/pnacl_translation_resource_host.h
@@ -31,6 +31,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 +55,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.
+ typedef std::map<PP_Instance, scoped_refptr<ppapi::TrackedCallback> >
+ EnsurePnaclInstalledMap;
// IPC::ChannelProxy::MessageFilter implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE;
@@ -61,12 +68,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_t current_progress,
+ int64_t total);
+ void CleanupEnsurePnaclRequests();
scoped_refptr<base::MessageLoopProxy> io_message_loop_;
IPC::Channel* channel_;
// 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