| OLD | NEW |
| 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/browser_ppp_widget.h" | 5 #include "native_client/src/shared/ppapi_proxy/browser_ppp_widget.h" |
| 6 | 6 |
| 7 // Include file order cannot be observed because ppp_instance declares a | 7 // Include file order cannot be observed because ppp_instance declares a |
| 8 // structure return type that causes an error on Windows. | 8 // structure return type that causes an error on Windows. |
| 9 // TODO(sehr, brettw): fix the return types and include order in PPAPI. | 9 // TODO(sehr, brettw): fix the return types and include order in PPAPI. |
| 10 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
| 11 #include "ppapi/c/pp_rect.h" | 11 #include "ppapi/c/pp_rect.h" |
| 12 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
| 13 #include "srpcgen/ppp_rpc.h" | 13 #include "srpcgen/ppp_rpc.h" |
| 14 #include "native_client/src/include/portability.h" | 14 #include "native_client/src/include/portability.h" |
| 15 #include "native_client/src/shared/ppapi_proxy/browser_globals.h" | 15 #include "native_client/src/shared/ppapi_proxy/browser_globals.h" |
| 16 #include "native_client/src/shared/ppapi_proxy/browser_ppp.h" | 16 #include "native_client/src/shared/ppapi_proxy/browser_ppp.h" |
| 17 #include "native_client/src/shared/ppapi_proxy/utility.h" | 17 #include "native_client/src/shared/ppapi_proxy/utility.h" |
| 18 | 18 |
| 19 namespace ppapi_proxy { | 19 namespace ppapi_proxy { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 const nacl_abi_size_t kPPRectBytes = | 23 const nacl_abi_size_t kPPRectBytes = |
| 24 static_cast<nacl_abi_size_t>(sizeof(PP_Rect)); | 24 static_cast<nacl_abi_size_t>(sizeof(PP_Rect)); |
| 25 | 25 |
| 26 void Invalidate(PP_Instance instance, | 26 void Invalidate(PP_Instance instance, |
| 27 PP_Resource widget, | 27 PP_Resource widget, |
| 28 const struct PP_Rect* dirty_rect) { | 28 const struct PP_Rect* dirty_rect) { |
| 29 DebugPrintf("PPP_Widget_Dev::Invalidate: instance=%"NACL_PRIu32"\n", | 29 DebugPrintf("PPP_Widget_Dev::Invalidate: instance=%"NACL_PRId32"\n", |
| 30 instance); | 30 instance); |
| 31 | 31 |
| 32 NaClSrpcError srpc_result = | 32 NaClSrpcError srpc_result = |
| 33 PppWidgetRpcClient::PPP_Widget_Invalidate( | 33 PppWidgetRpcClient::PPP_Widget_Invalidate( |
| 34 GetMainSrpcChannel(instance), | 34 GetMainSrpcChannel(instance), |
| 35 instance, | 35 instance, |
| 36 widget, | 36 widget, |
| 37 kPPRectBytes, | 37 kPPRectBytes, |
| 38 reinterpret_cast<char*>(const_cast<struct PP_Rect*>(dirty_rect))); | 38 reinterpret_cast<char*>(const_cast<struct PP_Rect*>(dirty_rect))); |
| 39 | 39 |
| 40 DebugPrintf("PPP_Widget_Dev::Invalidate: %s\n", | 40 DebugPrintf("PPP_Widget_Dev::Invalidate: %s\n", |
| 41 NaClSrpcErrorString(srpc_result)); | 41 NaClSrpcErrorString(srpc_result)); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace | 44 } // namespace |
| 45 | 45 |
| 46 const PPP_Widget_Dev* BrowserWidget::GetInterface() { | 46 const PPP_Widget_Dev* BrowserWidget::GetInterface() { |
| 47 static const PPP_Widget_Dev widget_interface = { | 47 static const PPP_Widget_Dev widget_interface = { |
| 48 Invalidate | 48 Invalidate |
| 49 }; | 49 }; |
| 50 return &widget_interface; | 50 return &widget_interface; |
| 51 } | 51 } |
| 52 | 52 |
| 53 } // namespace ppapi_proxy | 53 } // namespace ppapi_proxy |
| 54 | |
| OLD | NEW |