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

Unified Diff: ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h

Issue 393693004: Pepper: Delete FileDownloader in trusted plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: STL fix Created 6 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: ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h
index 44a1d549440109f391338882093a5f81adb36d33..ac1a330b862464a8ed72a6e5dfa35ff19e0518ff 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h
@@ -17,12 +17,12 @@
#include "ppapi/cpp/completion_callback.h"
-#include "ppapi/native_client/src/trusted/plugin/callback_source.h"
-#include "ppapi/native_client/src/trusted/plugin/file_downloader.h"
#include "ppapi/native_client/src/trusted/plugin/nacl_subprocess.h"
#include "ppapi/native_client/src/trusted/plugin/plugin_error.h"
#include "ppapi/native_client/src/trusted/plugin/pnacl_resources.h"
+#include "ppapi/utility/completion_callback_factory.h"
+
struct PP_PNaClOptions;
namespace plugin {
@@ -51,7 +51,7 @@ class TempFile;
// Translation proceeds in two steps:
// (1) llc translates the bitcode in pexe_url_ to an object in obj_file_.
// (2) ld links the object code in obj_file_ and produces a nexe in nexe_file_.
-class PnaclCoordinator: public CallbackSource<FileStreamData> {
+class PnaclCoordinator {
public:
// Maximum number of object files passable to the translator. Cannot be
// changed without changing the RPC signatures.
@@ -69,12 +69,6 @@ class PnaclCoordinator: public CallbackSource<FileStreamData> {
// BitcodeToNative has completed (and the finish_callback called).
PP_FileHandle TakeTranslatedFileHandle();
- // Implement FileDownloader's template of the CallbackSource interface.
- // This method returns a callback which will be called by the FileDownloader
- // to stream the bitcode data as it arrives. The callback
- // (BitcodeStreamGotData) passes it to llc over SRPC.
- StreamCallback GetCallback();
-
// Return a callback that should be notified when |bytes_compiled| bytes
// have been compiled.
pp::CompletionCallback GetCompileProgressCallback(int64_t bytes_compiled);
@@ -92,6 +86,16 @@ class PnaclCoordinator: public CallbackSource<FileStreamData> {
expected_pexe_size_) < kProgressEventSlopPct;
}
+
+ void BitcodeStreamCacheHit(PP_FileHandle handle);
+ void BitcodeStreamCacheMiss(int64_t expected_pexe_size);
+
+ // Invoked when a pexe data chunk arrives (when using streaming translation)
+ void BitcodeStreamGotData(const void* data, int32_t length);
+
+ // Invoked when the pexe download finishes (using streaming translation)
+ void BitcodeStreamDidFinish(int32_t pp_error);
+
private:
NACL_DISALLOW_COPY_AND_ASSIGN(PnaclCoordinator);
@@ -104,19 +108,9 @@ class PnaclCoordinator: public CallbackSource<FileStreamData> {
// Invoke to issue a GET request for bitcode.
void OpenBitcodeStream();
- // Invoked when we've started an URL fetch for the pexe to check for
- // caching metadata.
- void BitcodeStreamDidOpen(int32_t pp_error);
- // Invoked when we've gotten a temp FD for the nexe, either with the nexe
- // data, or a writeable fd to save to.
- void NexeFdDidOpen(int32_t pp_error);
- // Invoked when a pexe data chunk arrives (when using streaming translation)
- void BitcodeStreamGotData(int32_t pp_error, FileStreamData data);
// Invoked when a pexe data chunk is compiled.
void BitcodeGotCompiled(int32_t pp_error, int64_t bytes_compiled);
- // Invoked when the pexe download finishes (using streaming translation)
- void BitcodeStreamDidFinish(int32_t pp_error);
// Once llc and ld nexes have been loaded and the two temporary files have
// been created, this starts the translation. Translation starts two
// subprocesses, one for llc and one for ld.
@@ -180,12 +174,6 @@ class PnaclCoordinator: public CallbackSource<FileStreamData> {
// Translated nexe file, produced by the linker.
nacl::scoped_ptr<TempFile> temp_nexe_file_;
- // Passed to the browser, which sets it to true if there is a translation
- // cache hit.
- PP_Bool is_cache_hit_;
-
- // Downloader for streaming translation
- nacl::scoped_ptr<FileDownloader> streaming_downloader_;
// Used to report information when errors (PPAPI or otherwise) are reported.
ErrorInfo error_info_;
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/plugin.gypi ('k') | ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698