diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-08 16:32:18 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-08 16:32:18 +0000 |
commit | 19d2b0155d65336be11061af042d29ac7c06c84a (patch) | |
tree | 861c8e71044a5da1d32e31b0c7a2b6f678c6801e /ppapi/proxy | |
parent | 7cc320eb2d5538832212955de420b3339a0db499 (diff) | |
download | chromium_src-19d2b0155d65336be11061af042d29ac7c06c84a.zip chromium_src-19d2b0155d65336be11061af042d29ac7c06c84a.tar.gz chromium_src-19d2b0155d65336be11061af042d29ac7c06c84a.tar.bz2 |
Convert Chrome PPAPI proxy from bool to PP_Bool.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/4659001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65381 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy')
-rw-r--r-- | ppapi/proxy/interface_proxy.h | 8 | ||||
-rw-r--r-- | ppapi/proxy/ppapi_messages.h | 34 | ||||
-rw-r--r-- | ppapi/proxy/ppb_core_proxy.cc | 4 | ||||
-rw-r--r-- | ppapi/proxy/ppb_graphics_2d_proxy.cc | 26 | ||||
-rw-r--r-- | ppapi/proxy/ppb_graphics_2d_proxy.h | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppb_image_data_proxy.cc | 20 | ||||
-rw-r--r-- | ppapi/proxy/ppb_image_data_proxy.h | 5 | ||||
-rw-r--r-- | ppapi/proxy/ppb_instance_proxy.cc | 13 | ||||
-rw-r--r-- | ppapi/proxy/ppb_instance_proxy.h | 4 | ||||
-rw-r--r-- | ppapi/proxy/ppb_testing_proxy.cc | 10 | ||||
-rw-r--r-- | ppapi/proxy/ppb_testing_proxy.h | 2 | ||||
-rw-r--r-- | ppapi/proxy/ppb_url_loader_proxy.cc | 24 | ||||
-rw-r--r-- | ppapi/proxy/ppb_url_request_info_proxy.cc | 29 | ||||
-rw-r--r-- | ppapi/proxy/ppb_url_response_info_proxy.cc | 4 | ||||
-rw-r--r-- | ppapi/proxy/ppp_instance_proxy.cc | 36 | ||||
-rw-r--r-- | ppapi/proxy/ppp_instance_proxy.h | 8 | ||||
-rw-r--r-- | ppapi/proxy/serialized_var.cc | 8 |
17 files changed, 144 insertions, 94 deletions
diff --git a/ppapi/proxy/interface_proxy.h b/ppapi/proxy/interface_proxy.h index 538ebf5..33e19bb 100644 --- a/ppapi/proxy/interface_proxy.h +++ b/ppapi/proxy/interface_proxy.h @@ -70,6 +70,14 @@ class InterfaceProxy : public IPC::Channel::Listener, const void* target_interface_; }; +inline PP_Bool BoolToPPBool(bool value) { + return value ? PP_TRUE : PP_FALSE; +} + +inline bool PPBoolToBool(PP_Bool value) { + return (PP_TRUE == value); +} + } // namespace proxy } // namespace pp diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h index 89ba4e9..f8cb8a0 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -10,12 +10,46 @@ #include <vector> #include "base/basictypes.h" +#include "base/string16.h" #include "ipc/ipc_message_utils.h" +#include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_module.h" #include "ppapi/c/pp_resource.h" #include "ppapi/proxy/ppapi_param_traits.h" +namespace pp { +namespace proxy { + +// PP_FontDescript_Dev has to be redefined with a SerializedVar in place of +// the PP_Var used for the face name. +struct SerializedFontDescription { + pp::proxy::SerializedVar face; + int32_t family; + uint32_t size; + int32_t weight; + PP_Bool italic; + PP_Bool small_caps; + int32_t letter_spacing; + int32_t word_spacing; +}; + +struct PPBFont_DrawTextAt_Params { + PP_Resource font; + PP_Resource image_data; + pp::proxy::SerializedVar text; + PP_Bool text_is_rtl; + PP_Bool override_direction; + PP_Point position; + uint32_t color; + PP_Rect clip; + bool clip_is_null; + PP_Bool image_data_is_opaque; +}; + +} // namespace proxy +} // namespace pp + #define MESSAGES_INTERNAL_FILE "ppapi/proxy/ppapi_messages_internal.h" #include "ipc/ipc_message_macros.h" diff --git a/ppapi/proxy/ppb_core_proxy.cc b/ppapi/proxy/ppb_core_proxy.cc index 7d8c5f4..51d24d7 100644 --- a/ppapi/proxy/ppb_core_proxy.cc +++ b/ppapi/proxy/ppb_core_proxy.cc @@ -63,8 +63,8 @@ void CallOnMainThread(int delay_in_ms, delay_in_ms); } -bool IsMainThread() { - return GetMainThreadMessageLoop()->BelongsToCurrentThread(); +PP_Bool IsMainThread() { + return BoolToPPBool(GetMainThreadMessageLoop()->BelongsToCurrentThread()); } const PPB_Core core_interface = { diff --git a/ppapi/proxy/ppb_graphics_2d_proxy.cc b/ppapi/proxy/ppb_graphics_2d_proxy.cc index 99748fa..0567369 100644 --- a/ppapi/proxy/ppb_graphics_2d_proxy.cc +++ b/ppapi/proxy/ppb_graphics_2d_proxy.cc @@ -20,7 +20,7 @@ namespace proxy { class Graphics2D : public PluginResource { public: - Graphics2D(const PP_Size& size, bool is_always_opaque) + Graphics2D(const PP_Size& size, PP_Bool is_always_opaque) : size_(size), is_always_opaque_(is_always_opaque) { } @@ -28,11 +28,11 @@ class Graphics2D : public PluginResource { virtual Graphics2D* AsGraphics2D() { return this; } const PP_Size& size() const { return size_; } - bool is_always_opaque() const { return is_always_opaque_; } + PP_Bool is_always_opaque() const { return is_always_opaque_; } private: PP_Size size_; - bool is_always_opaque_; + PP_Bool is_always_opaque_; DISALLOW_COPY_AND_ASSIGN(Graphics2D); }; @@ -41,7 +41,7 @@ namespace { PP_Resource Create(PP_Module module_id, const PP_Size* size, - bool is_always_opaque) { + PP_Bool is_always_opaque) { PluginDispatcher* dispatcher = PluginDispatcher::Get(); PP_Resource result = 0; dispatcher->Send(new PpapiHostMsg_PPBGraphics2D_Create( @@ -54,25 +54,25 @@ PP_Resource Create(PP_Module module_id, return result; } -bool IsGraphics2D(PP_Resource resource) { +PP_Bool IsGraphics2D(PP_Resource resource) { Graphics2D* object = PluginResource::GetAs<Graphics2D>(resource); - return !!object; + return BoolToPPBool(!!object); } -bool Describe(PP_Resource graphics_2d, - PP_Size* size, - bool* is_always_opaque) { +PP_Bool Describe(PP_Resource graphics_2d, + PP_Size* size, + PP_Bool* is_always_opaque) { Graphics2D* object = PluginResource::GetAs<Graphics2D>(graphics_2d); if (!object) { size->width = 0; size->height = 0; - *is_always_opaque = false; - return false; + *is_always_opaque = PP_FALSE; + return PP_FALSE; } *size = object->size(); *is_always_opaque = object->is_always_opaque(); - return true; + return PP_TRUE; } void PaintImageData(PP_Resource graphics_2d, @@ -158,7 +158,7 @@ void PPB_Graphics2D_Proxy::OnMessageReceived(const IPC::Message& msg) { void PPB_Graphics2D_Proxy::OnMsgCreate(PP_Module module, const PP_Size& size, - bool is_always_opaque, + PP_Bool is_always_opaque, PP_Resource* result) { *result = ppb_graphics_2d_target()->Create( module, &size, is_always_opaque); diff --git a/ppapi/proxy/ppb_graphics_2d_proxy.h b/ppapi/proxy/ppb_graphics_2d_proxy.h index b5cabfb..db678eb 100644 --- a/ppapi/proxy/ppb_graphics_2d_proxy.h +++ b/ppapi/proxy/ppb_graphics_2d_proxy.h @@ -5,6 +5,7 @@ #ifndef PPAPI_PPB_GRAPHICS_2D_PROXY_H_ #define PPAPI_PPB_GRAPHICS_2D_PROXY_H_ +#include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_completion_callback.h" #include "ppapi/c/pp_module.h" #include "ppapi/c/pp_module.h" @@ -38,7 +39,7 @@ class PPB_Graphics2D_Proxy : public InterfaceProxy { // Message handlers. void OnMsgCreate(PP_Module module, const PP_Size& size, - bool is_always_opaque, + PP_Bool is_always_opaque, PP_Resource* result); void OnMsgPaintImageData(PP_Resource graphics_2d, PP_Resource image_data, diff --git a/ppapi/proxy/ppb_image_data_proxy.cc b/ppapi/proxy/ppb_image_data_proxy.cc index 19d0932..27d78726 100644 --- a/ppapi/proxy/ppb_image_data_proxy.cc +++ b/ppapi/proxy/ppb_image_data_proxy.cc @@ -94,8 +94,8 @@ PP_ImageDataFormat GetNativeImageDataFormat() { return static_cast<PP_ImageDataFormat>(format); } -bool IsImageDataFormatSupported(PP_ImageDataFormat format) { - bool supported = false; +PP_Bool IsImageDataFormatSupported(PP_ImageDataFormat format) { + PP_Bool supported = PP_FALSE; PluginDispatcher::Get()->Send( new PpapiHostMsg_PPBImageData_IsImageDataFormatSupported( INTERFACE_ID_PPB_IMAGE_DATA, static_cast<int32_t>(format), @@ -106,7 +106,7 @@ bool IsImageDataFormatSupported(PP_ImageDataFormat format) { PP_Resource Create(PP_Module module_id, PP_ImageDataFormat format, const PP_Size* size, - bool init_to_zero) { + PP_Bool init_to_zero) { PP_Resource result = 0; std::string image_data_desc; uint64_t shm_handle = -1; @@ -128,17 +128,17 @@ PP_Resource Create(PP_Module module_id, return result; } -bool IsImageData(PP_Resource resource) { +PP_Bool IsImageData(PP_Resource resource) { ImageData* object = PluginResource::GetAs<ImageData>(resource); - return !!object; + return BoolToPPBool(!!object); } -bool Describe(PP_Resource resource, PP_ImageDataDesc* desc) { +PP_Bool Describe(PP_Resource resource, PP_ImageDataDesc* desc) { ImageData* object = PluginResource::GetAs<ImageData>(resource); if (!object) - return false; + return PP_FALSE; memcpy(desc, &object->desc(), sizeof(PP_ImageDataDesc)); - return true; + return PP_TRUE; } void* Map(PP_Resource resource) { @@ -198,7 +198,7 @@ void PPB_ImageData_Proxy::OnMsgGetNativeImageDataFormat(int32* result) { } void PPB_ImageData_Proxy::OnMsgIsImageDataFormatSupported(int32 format, - bool* result) { + PP_Bool* result) { *result = ppb_image_data_target()->IsImageDataFormatSupported( static_cast<PP_ImageDataFormat>(format)); } @@ -206,7 +206,7 @@ void PPB_ImageData_Proxy::OnMsgIsImageDataFormatSupported(int32 format, void PPB_ImageData_Proxy::OnMsgCreate(PP_Module module, int32_t format, const PP_Size& size, - bool init_to_zero, + PP_Bool init_to_zero, PP_Resource* result, std::string* image_data_desc, uint64_t* result_shm_handle) { diff --git a/ppapi/proxy/ppb_image_data_proxy.h b/ppapi/proxy/ppb_image_data_proxy.h index 70d8ce0..fadfcc5 100644 --- a/ppapi/proxy/ppb_image_data_proxy.h +++ b/ppapi/proxy/ppb_image_data_proxy.h @@ -5,6 +5,7 @@ #ifndef PPAPI_PPB_IMAGE_DATA_PROXY_H_ #define PPAPI_PPB_IMAGE_DATA_PROXY_H_ +#include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_completion_callback.h" #include "ppapi/c/pp_module.h" #include "ppapi/c/pp_resource.h" @@ -34,11 +35,11 @@ class PPB_ImageData_Proxy : public InterfaceProxy { private: // Message handlers. void OnMsgGetNativeImageDataFormat(int32* result); - void OnMsgIsImageDataFormatSupported(int32 format, bool* result); + void OnMsgIsImageDataFormatSupported(int32 format, PP_Bool* result); void OnMsgCreate(PP_Module module, int32_t format, const PP_Size& size, - bool init_to_zero, + PP_Bool init_to_zero, PP_Resource* result, std::string* image_data_desc, uint64_t* result_shm_handle); diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc index 024673e..1703b74 100644 --- a/ppapi/proxy/ppb_instance_proxy.cc +++ b/ppapi/proxy/ppb_instance_proxy.cc @@ -31,15 +31,15 @@ PP_Var GetOwnerElementObject(PP_Instance instance) { return result.Return(dispatcher); } -bool BindGraphics(PP_Instance instance, PP_Resource device) { - bool result; +PP_Bool BindGraphics(PP_Instance instance, PP_Resource device) { + PP_Bool result; PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( INTERFACE_ID_PPB_INSTANCE, instance, device, &result)); return result; } -bool IsFullFrame(PP_Instance instance) { - bool result; +PP_Bool IsFullFrame(PP_Instance instance) { + PP_Bool result; PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBInstance_IsFullFrame( INTERFACE_ID_PPB_INSTANCE, instance, &result)); return result; @@ -115,11 +115,12 @@ void PPB_Instance_Proxy::OnMsgGetOwnerElementObject( void PPB_Instance_Proxy::OnMsgBindGraphics(PP_Instance instance, PP_Resource device, - bool* result) { + PP_Bool* result) { *result = ppb_instance_target()->BindGraphics(instance, device); } -void PPB_Instance_Proxy::OnMsgIsFullFrame(PP_Instance instance, bool* result) { +void PPB_Instance_Proxy::OnMsgIsFullFrame(PP_Instance instance, + PP_Bool* result) { *result = ppb_instance_target()->IsFullFrame(instance); } diff --git a/ppapi/proxy/ppb_instance_proxy.h b/ppapi/proxy/ppb_instance_proxy.h index 64b2b2d..578f38b 100644 --- a/ppapi/proxy/ppb_instance_proxy.h +++ b/ppapi/proxy/ppb_instance_proxy.h @@ -41,8 +41,8 @@ class PPB_Instance_Proxy : public InterfaceProxy { SerializedVarReturnValue result); void OnMsgBindGraphics(PP_Instance instance, PP_Resource device, - bool* result); - void OnMsgIsFullFrame(PP_Instance instance, bool* result); + PP_Bool* result); + void OnMsgIsFullFrame(PP_Instance instance, PP_Bool* result); void OnMsgExecuteScript(PP_Instance instance, SerializedVarReceiveInput script, SerializedVarOutParam out_exception, diff --git a/ppapi/proxy/ppb_testing_proxy.cc b/ppapi/proxy/ppb_testing_proxy.cc index 3eefada..d4ab8cc 100644 --- a/ppapi/proxy/ppb_testing_proxy.cc +++ b/ppapi/proxy/ppb_testing_proxy.cc @@ -14,10 +14,10 @@ namespace proxy { namespace { -bool ReadImageData(PP_Resource device_context_2d, - PP_Resource image, - const PP_Point* top_left) { - bool result = false; +PP_Bool ReadImageData(PP_Resource device_context_2d, + PP_Resource image, + const PP_Point* top_left) { + PP_Bool result = PP_FALSE; PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBTesting_ReadImageData( INTERFACE_ID_PPB_TESTING, device_context_2d, image, *top_left, &result)); return result; @@ -82,7 +82,7 @@ void PPB_Testing_Proxy::OnMessageReceived(const IPC::Message& msg) { void PPB_Testing_Proxy::OnMsgReadImageData(PP_Resource device_context_2d, PP_Resource image, const PP_Point& top_left, - bool* result) { + PP_Bool* result) { *result = ppb_testing_target()->ReadImageData( device_context_2d, image, &top_left); } diff --git a/ppapi/proxy/ppb_testing_proxy.h b/ppapi/proxy/ppb_testing_proxy.h index 3f4013e..547f8ab 100644 --- a/ppapi/proxy/ppb_testing_proxy.h +++ b/ppapi/proxy/ppb_testing_proxy.h @@ -35,7 +35,7 @@ class PPB_Testing_Proxy : public InterfaceProxy { void OnMsgReadImageData(PP_Resource device_context_2d, PP_Resource image, const PP_Point& top_left, - bool* result); + PP_Bool* result); void OnMsgRunMessageLoop(bool* dummy); void OnMsgQuitMessageLoop(); void OnMsgGetLiveObjectCount(PP_Module module_id, uint32_t* result); diff --git a/ppapi/proxy/ppb_url_loader_proxy.cc b/ppapi/proxy/ppb_url_loader_proxy.cc index b863de3..74ca2a1 100644 --- a/ppapi/proxy/ppb_url_loader_proxy.cc +++ b/ppapi/proxy/ppb_url_loader_proxy.cc @@ -75,9 +75,9 @@ PP_Resource Create(PP_Instance instance_id) { return result; } -bool IsURLLoader(PP_Resource resource) { +PP_Bool IsURLLoader(PP_Resource resource) { URLLoader* object = PluginResource::GetAs<URLLoader>(resource); - return !!object; + return BoolToPPBool(!!object); } int32_t Open(PP_Resource loader_id, @@ -99,32 +99,32 @@ int32_t FollowRedirect(PP_Resource loader_id, return PP_ERROR_WOULDBLOCK; } -bool GetUploadProgress(PP_Resource loader_id, - int64_t* bytes_sent, - int64_t* total_bytes_to_be_sent) { +PP_Bool GetUploadProgress(PP_Resource loader_id, + int64_t* bytes_sent, + int64_t* total_bytes_to_be_sent) { URLLoader* object = PluginResource::GetAs<URLLoader>(loader_id); if (!object || object->bytes_sent_ == -1) { *bytes_sent = 0; *total_bytes_to_be_sent = 0; - return false; + return PP_FALSE; } *bytes_sent = object->bytes_sent_; *total_bytes_to_be_sent = object->total_bytes_to_be_sent_; - return true; + return PP_TRUE; } -bool GetDownloadProgress(PP_Resource loader_id, - int64_t* bytes_received, - int64_t* total_bytes_to_be_received) { +PP_Bool GetDownloadProgress(PP_Resource loader_id, + int64_t* bytes_received, + int64_t* total_bytes_to_be_received) { URLLoader* object = PluginResource::GetAs<URLLoader>(loader_id); if (!object || object->bytes_received_ == -1) { *bytes_received = 0; *total_bytes_to_be_received = 0; - return false; + return PP_FALSE; } *bytes_received = object->bytes_received_; *total_bytes_to_be_received = object->total_bytes_to_be_received_; - return true; + return PP_TRUE; } PP_Resource GetResponseInfo(PP_Resource loader_id) { diff --git a/ppapi/proxy/ppb_url_request_info_proxy.cc b/ppapi/proxy/ppb_url_request_info_proxy.cc index 51ab4bb..2df496b 100644 --- a/ppapi/proxy/ppb_url_request_info_proxy.cc +++ b/ppapi/proxy/ppb_url_request_info_proxy.cc @@ -38,14 +38,14 @@ PP_Resource Create(PP_Module module_id) { return result; } -bool IsURLRequestInfo(PP_Resource resource) { +PP_Bool IsURLRequestInfo(PP_Resource resource) { URLRequestInfo* object = PluginResource::GetAs<URLRequestInfo>(resource); - return !!object; + return BoolToPPBool(!!object); } -bool SetProperty(PP_Resource request_id, - PP_URLRequestProperty_Dev property, - PP_Var var) { +PP_Bool SetProperty(PP_Resource request_id, + PP_URLRequestProperty_Dev property, + PP_Var var) { Dispatcher* dispatcher = PluginDispatcher::Get(); dispatcher->Send(new PpapiHostMsg_PPBURLRequestInfo_SetProperty( INTERFACE_ID_PPB_URL_REQUEST_INFO, request_id, @@ -54,10 +54,11 @@ bool SetProperty(PP_Resource request_id, // TODO(brettw) do some validation on the types. We should be able to tell on // the plugin side whether the request will succeed or fail in the renderer. - return true; + return PP_TRUE; } -bool AppendDataToBody(PP_Resource request_id, const char* data, uint32_t len) { +PP_Bool AppendDataToBody(PP_Resource request_id, + const char* data, uint32_t len) { PluginDispatcher::Get()->Send( new PpapiHostMsg_PPBURLRequestInfo_AppendDataToBody( INTERFACE_ID_PPB_URL_REQUEST_INFO, request_id, @@ -65,14 +66,14 @@ bool AppendDataToBody(PP_Resource request_id, const char* data, uint32_t len) { // TODO(brettw) do some validation. We should be able to tell on the plugin // side whether the request will succeed or fail in the renderer. - return true; + return PP_TRUE; } -bool AppendFileToBody(PP_Resource request_id, - PP_Resource file_ref_id, - int64_t start_offset, - int64_t number_of_bytes, - PP_Time expected_last_modified_time) { +PP_Bool AppendFileToBody(PP_Resource request_id, + PP_Resource file_ref_id, + int64_t start_offset, + int64_t number_of_bytes, + PP_Time expected_last_modified_time) { PluginDispatcher::Get()->Send( new PpapiHostMsg_PPBURLRequestInfo_AppendFileToBody( INTERFACE_ID_PPB_URL_REQUEST_INFO, request_id, file_ref_id, @@ -80,7 +81,7 @@ bool AppendFileToBody(PP_Resource request_id, // TODO(brettw) do some validation. We should be able to tell on the plugin // side whether the request will succeed or fail in the renderer. - return true; + return PP_TRUE; } const PPB_URLRequestInfo_Dev ppb_urlrequestinfo = { diff --git a/ppapi/proxy/ppb_url_response_info_proxy.cc b/ppapi/proxy/ppb_url_response_info_proxy.cc index 4412eeb..2fbd452 100644 --- a/ppapi/proxy/ppb_url_response_info_proxy.cc +++ b/ppapi/proxy/ppb_url_response_info_proxy.cc @@ -27,9 +27,9 @@ class URLResponseInfo : public PluginResource { namespace { -bool IsURLResponseInfo(PP_Resource resource) { +PP_Bool IsURLResponseInfo(PP_Resource resource) { URLResponseInfo* object = PluginResource::GetAs<URLResponseInfo>(resource); - return !!object; + return BoolToPPBool(!!object); } PP_Var GetProperty(PP_Resource response, PP_URLResponseProperty_Dev property) { diff --git a/ppapi/proxy/ppp_instance_proxy.cc b/ppapi/proxy/ppp_instance_proxy.cc index 0b5a889..ccc6803 100644 --- a/ppapi/proxy/ppp_instance_proxy.cc +++ b/ppapi/proxy/ppp_instance_proxy.cc @@ -17,10 +17,10 @@ namespace proxy { namespace { -bool DidCreate(PP_Instance instance, - uint32_t argc, - const char* argn[], - const char* argv[]) { +PP_Bool DidCreate(PP_Instance instance, + uint32_t argc, + const char* argn[], + const char* argv[]) { std::vector<std::string> argn_vect; std::vector<std::string> argv_vect; for (uint32_t i = 0; i < argc; i++) { @@ -28,7 +28,7 @@ bool DidCreate(PP_Instance instance, argv_vect.push_back(std::string(argv[i])); } - bool result = false; + PP_Bool result = PP_FALSE; HostDispatcher::GetForInstance(instance)->Send( new PpapiMsg_PPPInstance_DidCreate(INTERFACE_ID_PPP_INSTANCE, instance, argn_vect, argv_vect, &result)); @@ -48,24 +48,24 @@ void DidChangeView(PP_Instance instance, instance, *position, *clip)); } -void DidChangeFocus(PP_Instance instance, bool has_focus) { +void DidChangeFocus(PP_Instance instance, PP_Bool has_focus) { HostDispatcher::GetForInstance(instance)->Send( new PpapiMsg_PPPInstance_DidChangeFocus(INTERFACE_ID_PPP_INSTANCE, instance, has_focus)); } -bool HandleInputEvent(PP_Instance instance, - const PP_InputEvent* event) { - bool result = false; +PP_Bool HandleInputEvent(PP_Instance instance, + const PP_InputEvent* event) { + PP_Bool result = PP_FALSE; HostDispatcher::GetForInstance(instance)->Send( new PpapiMsg_PPPInstance_HandleInputEvent(INTERFACE_ID_PPP_INSTANCE, instance, *event, &result)); return result; } -bool HandleDocumentLoad(PP_Instance instance, - PP_Resource url_loader) { - bool result = false; +PP_Bool HandleDocumentLoad(PP_Instance instance, + PP_Resource url_loader) { + PP_Bool result = PP_FALSE; HostDispatcher::GetForInstance(instance)->Send( new PpapiMsg_PPPInstance_HandleDocumentLoad(INTERFACE_ID_PPP_INSTANCE, instance, url_loader, @@ -132,8 +132,8 @@ void PPP_Instance_Proxy::OnMsgDidCreate( PP_Instance instance, const std::vector<std::string>& argn, const std::vector<std::string>& argv, - bool* result) { - *result = false; + PP_Bool* result) { + *result = PP_FALSE; if (argn.size() != argv.size()) return; @@ -141,7 +141,7 @@ void PPP_Instance_Proxy::OnMsgDidCreate( // address below. std::vector<const char*> argn_array( std::max(static_cast<size_t>(1), argn.size())); - std::vector<const char*> argv_array; + std::vector<const char*> argv_array( std::max(static_cast<size_t>(1), argn.size())); for (size_t i = 0; i < argn.size(); i++) { argn_array[i] = argn[i].c_str(); @@ -166,19 +166,19 @@ void PPP_Instance_Proxy::OnMsgDidChangeView(PP_Instance instance, } void PPP_Instance_Proxy::OnMsgDidChangeFocus(PP_Instance instance, - bool has_focus) { + PP_Bool has_focus) { ppp_instance_target()->DidChangeFocus(instance, has_focus); } void PPP_Instance_Proxy::OnMsgHandleInputEvent(PP_Instance instance, const PP_InputEvent& event, - bool* result) { + PP_Bool* result) { *result = ppp_instance_target()->HandleInputEvent(instance, &event); } void PPP_Instance_Proxy::OnMsgHandleDocumentLoad(PP_Instance instance, PP_Resource url_loader, - bool* result) { + PP_Bool* result) { PPB_URLLoader_Proxy::TrackPluginResource(url_loader); *result = ppp_instance_target()->HandleDocumentLoad( instance, url_loader); diff --git a/ppapi/proxy/ppp_instance_proxy.h b/ppapi/proxy/ppp_instance_proxy.h index 9fe40b9..9df247b 100644 --- a/ppapi/proxy/ppp_instance_proxy.h +++ b/ppapi/proxy/ppp_instance_proxy.h @@ -41,18 +41,18 @@ class PPP_Instance_Proxy : public InterfaceProxy { void OnMsgDidCreate(PP_Instance instance, const std::vector<std::string>& argn, const std::vector<std::string>& argv, - bool* result); + PP_Bool* result); void OnMsgDidDestroy(PP_Instance instance); void OnMsgDidChangeView(PP_Instance instance, const PP_Rect& position, const PP_Rect& clip); - void OnMsgDidChangeFocus(PP_Instance instance, bool has_focus); + void OnMsgDidChangeFocus(PP_Instance instance, PP_Bool has_focus); void OnMsgHandleInputEvent(PP_Instance instance, const PP_InputEvent& event, - bool* result); + PP_Bool* result); void OnMsgHandleDocumentLoad(PP_Instance instance, PP_Resource url_loader, - bool* result); + PP_Bool* result); void OnMsgGetInstanceObject(PP_Instance instance, SerializedVarReturnValue result); }; diff --git a/ppapi/proxy/serialized_var.cc b/ppapi/proxy/serialized_var.cc index 66a16c3..ef968ea 100644 --- a/ppapi/proxy/serialized_var.cc +++ b/ppapi/proxy/serialized_var.cc @@ -7,6 +7,7 @@ #include "base/logging.h" #include "ipc/ipc_message_utils.h" #include "ppapi/proxy/dispatcher.h" +#include "ppapi/proxy/interface_proxy.h" #include "ppapi/proxy/ppapi_param_traits.h" #include "ppapi/proxy/var_serialization_rules.h" @@ -171,9 +172,12 @@ bool SerializedVar::Inner::ReadFromMessage(const IPC::Message* m, void** iter) { // just serialized. success = true; break; - case PP_VARTYPE_BOOL: - success = m->ReadBool(iter, &var_.value.as_bool); + case PP_VARTYPE_BOOL: { + bool bool_value; + success = m->ReadBool(iter, &bool_value); + var_.value.as_bool = BoolToPPBool(bool_value); break; + } case PP_VARTYPE_INT32: success = m->ReadInt(iter, &var_.value.as_int); break; |