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

Unified Diff: ppapi/cpp/completion_callback.h

Issue 16569002: Use HTTP response headers for PNaCl caching instead of bitcode hash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use RunAndClear Created 7 years, 6 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
« no previous file with comments | « no previous file | ppapi/native_client/src/trusted/plugin/file_downloader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/completion_callback.h
diff --git a/ppapi/cpp/completion_callback.h b/ppapi/cpp/completion_callback.h
index cdd8b063e933bf759ffca61ae68dac6974897078..14d67846aa1884e81e98ec1cc4a82271954b9c26 100644
--- a/ppapi/cpp/completion_callback.h
+++ b/ppapi/cpp/completion_callback.h
@@ -85,6 +85,19 @@ class CompletionCallback {
PP_RunCompletionCallback(&cc_, result);
}
+ /// RunAndClear() is used to run the <code>CompletionCallback</code> and
+ /// clear out the callback so that it cannot be run a second time.
+ ///
+ /// @param[in] result The result of the operation to be passed to the
+ /// callback function. Non-positive values correspond to the error codes
+ /// from <code>pp_errors.h</code> (excluding
+ /// <code>PP_OK_COMPLETIONPENDING</code>). Positive values indicate
+ /// additional information such as bytes read.
+ void RunAndClear(int32_t result) {
+ PP_DCHECK(cc_.func);
+ PP_RunAndClearCompletionCallback(&cc_, result);
+ }
+
/// IsOptional() is used to determine the setting of the
/// <code>PP_COMPLETIONCALLBACK_FLAG_OPTIONAL</code> flag. This flag allows
/// any method taking such callback to complete synchronously
« no previous file with comments | « no previous file | ppapi/native_client/src/trusted/plugin/file_downloader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698