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

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

Issue 8351023: PPAPI NaCl Proxy: optimize PPB_Fullscreen::IsFullscreen. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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) 2011 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_instance_data.h"
5 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h" 6 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h"
6 #include "native_client/src/shared/ppapi_proxy/plugin_globals.h" 7 #include "native_client/src/shared/ppapi_proxy/plugin_globals.h"
7 #include "native_client/src/shared/ppapi_proxy/utility.h" 8 #include "native_client/src/shared/ppapi_proxy/utility.h"
8 #include "ppapi/c/pp_size.h" 9 #include "ppapi/c/pp_size.h"
9 #include "ppapi/c/ppb_fullscreen.h" 10 #include "ppapi/c/ppb_fullscreen.h"
10 #include "srpcgen/ppb_rpc.h" 11 #include "srpcgen/ppb_rpc.h"
11 12
12 namespace ppapi_proxy { 13 namespace ppapi_proxy {
13 14
14 namespace { 15 namespace {
15 16
16 PP_Bool IsFullscreen(PP_Instance instance) { 17 PP_Bool IsFullscreen(PP_Instance instance) {
17 DebugPrintf("PPB_Fullscreen::IsFullscreen: instance=%"NACL_PRIu32"\n", 18 DebugPrintf("PPB_Fullscreen::IsFullscreen: instance=%"NACL_PRIu32"\n",
18 instance); 19 instance);
19 20 return PluginInstanceData::IsFullscreen(instance) ? PP_TRUE : PP_FALSE;
20 int32_t success;
21 NaClSrpcError srpc_result =
22 PpbFullscreenRpcClient::PPB_Fullscreen_IsFullscreen(
23 GetMainSrpcChannel(), instance, &success);
24 DebugPrintf("PPB_Fullscreen::IsFullscreen: %s\n",
25 NaClSrpcErrorString(srpc_result));
26
27 if (srpc_result == NACL_SRPC_RESULT_OK && success)
28 return PP_TRUE;
29 return PP_FALSE;
30 } 21 }
31 22
32 23
33 PP_Bool SetFullscreen(PP_Instance instance, PP_Bool fullscreen) { 24 PP_Bool SetFullscreen(PP_Instance instance, PP_Bool fullscreen) {
34 DebugPrintf("PPB_Fullscreen::SetFullscreen: " 25 DebugPrintf("PPB_Fullscreen::SetFullscreen: "
35 "instance=%"NACL_PRIu32" fullscreen=%d\n", instance, fullscreen); 26 "instance=%"NACL_PRIu32" fullscreen=%d\n", instance, fullscreen);
36 27
37 int32_t success; 28 int32_t success;
38 NaClSrpcError srpc_result = 29 NaClSrpcError srpc_result =
39 PpbFullscreenRpcClient::PPB_Fullscreen_SetFullscreen( 30 PpbFullscreenRpcClient::PPB_Fullscreen_SetFullscreen(
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 const PPB_Fullscreen* PluginFullscreen::GetInterface() { 70 const PPB_Fullscreen* PluginFullscreen::GetInterface() {
80 static const PPB_Fullscreen fullscreen_interface = { 71 static const PPB_Fullscreen fullscreen_interface = {
81 IsFullscreen, 72 IsFullscreen,
82 SetFullscreen, 73 SetFullscreen,
83 GetScreenSize 74 GetScreenSize
84 }; 75 };
85 return &fullscreen_interface; 76 return &fullscreen_interface;
86 } 77 }
87 78
88 } // namespace ppapi_proxy 79 } // namespace ppapi_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698