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

Unified Diff: src/trusted/plugin/srpc/closure.h

Issue 1092005: Issue 1092005 (Closed) Base URL: http://nativeclient.googlecode.com/svn/trunk/src/native_client/
Patch Set: Created 10 years, 9 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: src/trusted/plugin/srpc/closure.h
===================================================================
--- src/trusted/plugin/srpc/closure.h (revision 1695)
+++ src/trusted/plugin/srpc/closure.h (working copy)
@@ -8,6 +8,7 @@
#ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_CLOSURE_H_
#define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SRPC_CLOSURE_H_
+#include <list>
#include <string>
#include "native_client/src/shared/npruntime/npmodule.h"
@@ -37,6 +38,7 @@
}
}
virtual ~Closure() {}
+ /* TODO(adonovan): documentation, especially nullness invariants. */
virtual void Run(NPStream *stream, const char *fname) = 0;
virtual void Run(const char *url, const void* buffer, int32_t size) = 0;
bool StartDownload();
@@ -49,6 +51,7 @@
nacl::StreamBuffer* buffer() { return buffer_; }
protected:
Plugin* plugin() { return plugin_; }
+ const std::string& url() const { return url_; }
private:
Plugin* plugin_;
std::string url_;
@@ -58,10 +61,16 @@
class LoadNaClAppNotify : public Closure {
public:
- LoadNaClAppNotify(Plugin *plugin, std::string url);
+ // Precondition: urls.list() > 0.
+ LoadNaClAppNotify(Plugin *plugin, const std::list<std::string>& urls);
virtual ~LoadNaClAppNotify();
+ // Run(NULL, NULL) is called if the request failed; a new request
+ // for the fallback_urls should be initiated.
virtual void Run(NPStream* stream, const char* fname);
virtual void Run(const char *url, const void* buffer, int32_t size);
+ private:
+ // The list of alternative URLs to try should this request fail.
+ std::list<std::string> fallback_urls_;
};
class UrlAsNaClDescNotify : public Closure {

Powered by Google App Engine
This is Rietveld 408576698