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

Side by Side Diff: ppapi/native_client/src/shared/ppapi_proxy/plugin_nacl_file.cc

Issue 9253011: Pepper SRPC proxy style and type nits (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bad license to pass presubmit check Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be 3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file. 4 found in the LICENSE file.
5 */ 5 */
6 6
7 #include "native_client/src/include/nacl_macros.h" 7 #include "native_client/src/include/nacl_macros.h"
8 #include "native_client/src/shared/ppapi_proxy/plugin_callback.h" 8 #include "native_client/src/shared/ppapi_proxy/plugin_callback.h"
9 #include "native_client/src/shared/ppapi_proxy/plugin_globals.h" 9 #include "native_client/src/shared/ppapi_proxy/plugin_globals.h"
10 #include "native_client/src/shared/ppapi_proxy/plugin_nacl_file.h" 10 #include "native_client/src/shared/ppapi_proxy/plugin_nacl_file.h"
11 #include "native_client/src/shared/ppapi_proxy/utility.h" 11 #include "native_client/src/shared/ppapi_proxy/utility.h"
12 #include "native_client/src/shared/srpc/nacl_srpc.h" 12 #include "native_client/src/shared/srpc/nacl_srpc.h"
13 #include "ppapi/c/pp_errors.h" 13 #include "ppapi/c/pp_errors.h"
14 #include "srpcgen/ppb_rpc.h" 14 #include "srpcgen/ppb_rpc.h"
15 15
16 namespace ppapi_proxy { 16 namespace ppapi_proxy {
17 17
18 int32_t StreamAsFile(PP_Instance instance, 18 int32_t StreamAsFile(PP_Instance instance,
19 const char* url, 19 const char* url,
20 struct PP_CompletionCallback callback) { 20 struct PP_CompletionCallback callback) {
21 DebugPrintf("NaClFile::StreamAsFile: instance=%"NACL_PRIu32" url=%s\n", 21 DebugPrintf("NaClFile::StreamAsFile: instance=%"NACL_PRId32" url=%s\n",
22 instance, url); 22 instance, url);
23 23
24 int32_t callback_id = 24 int32_t callback_id =
25 CompletionCallbackTable::Get()->AddCallback(callback); 25 CompletionCallbackTable::Get()->AddCallback(callback);
26 if (callback_id == 0) 26 if (callback_id == 0)
27 return PP_ERROR_BLOCKS_MAIN_THREAD; 27 return PP_ERROR_BLOCKS_MAIN_THREAD;
28 28
29 NaClSrpcError srpc_result = NaClFileRpcClient::StreamAsFile( 29 NaClSrpcError srpc_result = NaClFileRpcClient::StreamAsFile(
30 GetMainSrpcChannel(), instance, const_cast<char*>(url), callback_id); 30 GetMainSrpcChannel(), instance, const_cast<char*>(url), callback_id);
31 DebugPrintf("NaClFile::StreamAsFile: %s\n", NaClSrpcErrorString(srpc_result)); 31 DebugPrintf("NaClFile::StreamAsFile: %s\n", NaClSrpcErrorString(srpc_result));
32 32
33 if (srpc_result == NACL_SRPC_RESULT_OK) 33 if (srpc_result == NACL_SRPC_RESULT_OK)
34 return PP_OK_COMPLETIONPENDING; 34 return PP_OK_COMPLETIONPENDING;
35 return MayForceCallback(callback, PP_ERROR_FAILED); 35 return MayForceCallback(callback, PP_ERROR_FAILED);
36 } 36 }
37 37
38 38
39 int GetFileDesc(PP_Instance instance, const char* url) { 39 int GetFileDesc(PP_Instance instance, const char* url) {
40 DebugPrintf("NaClFile::GetFileDesc: instance=%"NACL_PRIu32" url=%s\n", 40 DebugPrintf("NaClFile::GetFileDesc: instance=%"NACL_PRId32" url=%s\n",
41 instance, url); 41 instance, url);
42 42
43 int file_desc; 43 int file_desc;
44 NaClSrpcError srpc_result = NaClFileRpcClient::GetFileDesc( 44 NaClSrpcError srpc_result = NaClFileRpcClient::GetFileDesc(
45 GetMainSrpcChannel(), instance, const_cast<char*>(url), &file_desc); 45 GetMainSrpcChannel(), instance, const_cast<char*>(url), &file_desc);
46 DebugPrintf("NaClFile::GetFileDesc: %s\n", NaClSrpcErrorString(srpc_result)); 46 DebugPrintf("NaClFile::GetFileDesc: %s\n", NaClSrpcErrorString(srpc_result));
47 47
48 if (srpc_result == NACL_SRPC_RESULT_OK) 48 if (srpc_result == NACL_SRPC_RESULT_OK)
49 return file_desc; 49 return file_desc;
50 return NACL_NO_FILE_DESC; 50 return NACL_NO_FILE_DESC;
51 } 51 }
52 52
53 } // namespace ppapi_proxy 53 } // namespace ppapi_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698