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

Unified Diff: ppapi/native_client/src/shared/ppapi_proxy/browser_callback.h

Issue 7740013: Cloning a bunch of stuff from the native_client repository at r6528 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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/shared/ppapi_proxy/browser_callback.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/native_client/src/shared/ppapi_proxy/browser_callback.h
===================================================================
--- ppapi/native_client/src/shared/ppapi_proxy/browser_callback.h (revision 0)
+++ ppapi/native_client/src/shared/ppapi_proxy/browser_callback.h (revision 0)
@@ -0,0 +1,50 @@
+// Copyright (c) 2011 The Native Client Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_CALLBACK_H_
+#define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_CALLBACK_H_
+
+#include "native_client/src/include/portability.h"
+#include "native_client/src/trusted/service_runtime/include/machine/_types.h"
+
+struct NaClSrpcChannel;
+struct PP_CompletionCallback;
+
+namespace ppapi_proxy {
+
+// Pointer to function to evaluate the result of a read operation.
+typedef bool (*CheckResultFunc)(int32_t result);
+// Pointer to function to retrieve/calculate the size read.
+typedef nacl_abi_size_t (*GetReadSizeFunc)(int32_t result);
+
+// Returns a PP_CompletionCallback that will call the remote implementation of
+// a callback by |callback_id| on the plugin side on |srpc_channel|.
+// This callback allows for optimized synchronous completion.
+// Allocates data that will be deleted by the underlying callback function.
+// Returns NULL callback on failure.
+struct PP_CompletionCallback MakeRemoteCompletionCallback(
+ NaClSrpcChannel* srpc_channel,
+ int32_t callback_id);
+struct PP_CompletionCallback MakeRemoteCompletionCallback(
+ NaClSrpcChannel* srpc_channel,
+ int32_t callback_id,
+ // For callbacks invoked on a byte read.
+ int32_t bytes_to_read,
+ char** buffer);
+struct PP_CompletionCallback MakeRemoteCompletionCallback(
+ NaClSrpcChannel* srpc_channel,
+ int32_t callback_id,
+ // For callbacks invoked on a byte read.
+ int32_t bytes_to_read,
+ char** buffer,
+ CheckResultFunc check_result,
+ GetReadSizeFunc get_size_read_func);
+
+// If the callback won't be called, use this to clean up the data from
+// the function above.
+void DeleteRemoteCallbackInfo(struct PP_CompletionCallback callback);
+
+} // namespace ppapi_proxy
+
+#endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_CALLBACK_H_
« no previous file with comments | « no previous file | ppapi/native_client/src/shared/ppapi_proxy/browser_callback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698