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

Side by Side Diff: ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_mouse_lock.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 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_mouse_lock.h" 5 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_mouse_lock.h"
6 6
7 #include "native_client/src/include/portability.h" 7 #include "native_client/src/include/portability.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/utility.h" 10 #include "native_client/src/shared/ppapi_proxy/utility.h"
11 #include "ppapi/c/pp_completion_callback.h" 11 #include "ppapi/c/pp_completion_callback.h"
12 #include "ppapi/c/pp_errors.h" 12 #include "ppapi/c/pp_errors.h"
13 #include "ppapi/c/ppb_mouse_lock.h" 13 #include "ppapi/c/ppb_mouse_lock.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 namespace { 18 namespace {
19 19
20 int32_t LockMouse(PP_Instance instance, PP_CompletionCallback callback) { 20 int32_t LockMouse(PP_Instance instance, PP_CompletionCallback callback) {
21 DebugPrintf("PPB_MouseLock::LockMouse: " 21 DebugPrintf("PPB_MouseLock::LockMouse: "
22 "instance=%"NACL_PRIu32"\n", instance); 22 "instance=%"NACL_PRId32"\n", instance);
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_BADARGUMENT; 27 return PP_ERROR_BADARGUMENT;
28 28
29 int32_t pp_error = PP_ERROR_FAILED; 29 int32_t pp_error = PP_ERROR_FAILED;
30 NaClSrpcError srpc_result = 30 NaClSrpcError srpc_result =
31 PpbMouseLockRpcClient::PPB_MouseLock_LockMouse( 31 PpbMouseLockRpcClient::PPB_MouseLock_LockMouse(
32 GetMainSrpcChannel(), 32 GetMainSrpcChannel(),
33 instance, 33 instance,
34 callback_id, 34 callback_id,
35 &pp_error); 35 &pp_error);
36 36
37 DebugPrintf("PPB_MouseLock::LockMouse: %s\n", 37 DebugPrintf("PPB_MouseLock::LockMouse: %s\n",
38 NaClSrpcErrorString(srpc_result)); 38 NaClSrpcErrorString(srpc_result));
39 39
40 if (srpc_result != NACL_SRPC_RESULT_OK) 40 if (srpc_result != NACL_SRPC_RESULT_OK)
41 pp_error = PP_ERROR_FAILED; 41 pp_error = PP_ERROR_FAILED;
42 return MayForceCallback(callback, pp_error); 42 return MayForceCallback(callback, pp_error);
43 } 43 }
44 44
45 void UnlockMouse(PP_Instance instance) { 45 void UnlockMouse(PP_Instance instance) {
46 DebugPrintf("PPB_MouseLock::UnlockMouse: " 46 DebugPrintf("PPB_MouseLock::UnlockMouse: "
47 "instance=%"NACL_PRIu32"\n", instance); 47 "instance=%"NACL_PRId32"\n", instance);
48 48
49 NaClSrpcError srpc_result = 49 NaClSrpcError srpc_result =
50 PpbMouseLockRpcClient::PPB_MouseLock_UnlockMouse( 50 PpbMouseLockRpcClient::PPB_MouseLock_UnlockMouse(
51 GetMainSrpcChannel(), 51 GetMainSrpcChannel(),
52 instance); 52 instance);
53 53
54 DebugPrintf("PPB_MouseLock::UnlockMouse: %s\n", 54 DebugPrintf("PPB_MouseLock::UnlockMouse: %s\n",
55 NaClSrpcErrorString(srpc_result)); 55 NaClSrpcErrorString(srpc_result));
56 } 56 }
57 57
58 } // namespace 58 } // namespace
59 59
60 const PPB_MouseLock* PluginMouseLock::GetInterface() { 60 const PPB_MouseLock* PluginMouseLock::GetInterface() {
61 static const PPB_MouseLock mouse_lock_interface = { 61 static const PPB_MouseLock mouse_lock_interface = {
62 LockMouse, 62 LockMouse,
63 UnlockMouse 63 UnlockMouse
64 }; 64 };
65 return &mouse_lock_interface; 65 return &mouse_lock_interface;
66 } 66 }
67 67
68 } // namespace ppapi_proxy 68 } // namespace ppapi_proxy
69
70
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698