diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-08 05:22:45 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-08 05:22:45 +0000 |
commit | 8a855a09b24c77e1b25471a3e3839926630f9e38 (patch) | |
tree | fb4a8c175d00726bb6d1924b91322e2209be2875 /ppapi | |
parent | 67512c7eb8d859c2b7b22f38cce2d9562ac049ca (diff) | |
download | chromium_src-8a855a09b24c77e1b25471a3e3839926630f9e38.zip chromium_src-8a855a09b24c77e1b25471a3e3839926630f9e38.tar.gz chromium_src-8a855a09b24c77e1b25471a3e3839926630f9e38.tar.bz2 |
Remove PPBoolToBool and BoolToPPBool and use PP_FromBool and PP_ToBool instead.
I will remove ppapi/cpp/common.h when I'm sure nacl doesn't need it.
TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/7237039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91809 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
29 files changed, 70 insertions, 103 deletions
diff --git a/ppapi/cpp/core.cc b/ppapi/cpp/core.cc index 146a362..36c4e8a 100644 --- a/ppapi/cpp/core.cc +++ b/ppapi/cpp/core.cc @@ -4,7 +4,6 @@ #include "ppapi/cpp/core.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/completion_callback.h" namespace pp { @@ -20,7 +19,7 @@ void Core::CallOnMainThread(int32_t delay_in_milliseconds, } bool Core::IsMainThread() { - return PPBoolToBool(interface_->IsMainThread()); + return PP_ToBool(interface_->IsMainThread()); } } // namespace pp diff --git a/ppapi/cpp/dev/find_dev.cc b/ppapi/cpp/dev/find_dev.cc index 31a25bd..9a29a5d 100644 --- a/ppapi/cpp/dev/find_dev.cc +++ b/ppapi/cpp/dev/find_dev.cc @@ -5,7 +5,6 @@ #include "ppapi/cpp/dev/find_dev.h" #include "ppapi/c/dev/ppb_find_dev.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/module_impl.h" @@ -28,15 +27,15 @@ PP_Bool StartFind(PP_Instance instance, if (!object) return PP_FALSE; bool return_value = static_cast<Find_Dev*>(object)->StartFind( - text, PPBoolToBool(case_sensitive)); - return BoolToPPBool(return_value); + text, PP_ToBool(case_sensitive)); + return PP_FromBool(return_value); } void SelectFindResult(PP_Instance instance, PP_Bool forward) { void* object = pp::Instance::GetPerInstanceObject(instance, kPPPFindInterface); if (object) - static_cast<Find_Dev*>(object)->SelectFindResult(PPBoolToBool(forward)); + static_cast<Find_Dev*>(object)->SelectFindResult(PP_ToBool(forward)); } void StopFind(PP_Instance instance) { @@ -66,7 +65,7 @@ Find_Dev::~Find_Dev() { void Find_Dev::NumberOfFindResultsChanged(int32_t total, bool final_result) { if (has_interface<PPB_Find_Dev>()) { get_interface<PPB_Find_Dev>()->NumberOfFindResultsChanged( - associated_instance_->pp_instance(), total, BoolToPPBool(final_result)); + associated_instance_->pp_instance(), total, PP_FromBool(final_result)); } } diff --git a/ppapi/cpp/dev/font_dev.cc b/ppapi/cpp/dev/font_dev.cc index 8c04de1..568e816 100644 --- a/ppapi/cpp/dev/font_dev.cc +++ b/ppapi/cpp/dev/font_dev.cc @@ -6,7 +6,6 @@ #include <algorithm> -#include "ppapi/cpp/common.h" #include "ppapi/cpp/image_data.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/point.h" @@ -75,8 +74,8 @@ TextRun_Dev::TextRun_Dev(const std::string& text, bool override_direction) : text_(text) { pp_text_run_.text = text_.pp_var(); - pp_text_run_.rtl = BoolToPPBool(rtl); - pp_text_run_.override_direction = BoolToPPBool(override_direction); + pp_text_run_.rtl = PP_FromBool(rtl); + pp_text_run_.override_direction = PP_FromBool(override_direction); } TextRun_Dev::TextRun_Dev(const TextRun_Dev& other) : text_(other.text_) { @@ -151,14 +150,14 @@ bool Font_Dev::DrawTextAt(ImageData* dest, bool image_data_is_opaque) const { if (!has_interface<PPB_Font_Dev>()) return false; - return PPBoolToBool(get_interface<PPB_Font_Dev>()->DrawTextAt( + return PP_ToBool(get_interface<PPB_Font_Dev>()->DrawTextAt( pp_resource(), dest->pp_resource(), &text.pp_text_run(), &position.pp_point(), color, &clip.pp_rect(), - BoolToPPBool(image_data_is_opaque))); + PP_FromBool(image_data_is_opaque))); } int32_t Font_Dev::MeasureText(const TextRun_Dev& text) const { diff --git a/ppapi/cpp/dev/font_dev.h b/ppapi/cpp/dev/font_dev.h index e95edbe..7fc5c41 100644 --- a/ppapi/cpp/dev/font_dev.h +++ b/ppapi/cpp/dev/font_dev.h @@ -8,7 +8,6 @@ #include <string> #include "ppapi/c/dev/ppb_font_dev.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/resource.h" #include "ppapi/cpp/var.h" @@ -51,14 +50,14 @@ class FontDescription_Dev { PP_FontWeight_Dev weight() const { return pp_font_description_.weight; } void set_weight(PP_FontWeight_Dev w) { pp_font_description_.weight = w; } - bool italic() const { return PPBoolToBool(pp_font_description_.italic); } - void set_italic(bool i) { pp_font_description_.italic = BoolToPPBool(i); } + bool italic() const { return PP_ToBool(pp_font_description_.italic); } + void set_italic(bool i) { pp_font_description_.italic = PP_FromBool(i); } bool small_caps() const { - return PPBoolToBool(pp_font_description_.small_caps); + return PP_ToBool(pp_font_description_.small_caps); } void set_small_caps(bool s) { - pp_font_description_.small_caps = BoolToPPBool(s); + pp_font_description_.small_caps = PP_FromBool(s); } int letter_spacing() const { return pp_font_description_.letter_spacing; } diff --git a/ppapi/cpp/dev/fullscreen_dev.cc b/ppapi/cpp/dev/fullscreen_dev.cc index 11bb09a..46af7ea 100644 --- a/ppapi/cpp/dev/fullscreen_dev.cc +++ b/ppapi/cpp/dev/fullscreen_dev.cc @@ -5,7 +5,6 @@ #include "ppapi/cpp/dev/fullscreen_dev.h" #include "ppapi/c/dev/ppb_fullscreen_dev.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/module_impl.h" @@ -37,14 +36,14 @@ bool Fullscreen_Dev::IsFullscreen() { bool Fullscreen_Dev::SetFullscreen(bool fullscreen) { if (!has_interface<PPB_Fullscreen_Dev>()) return false; - return PPBoolToBool(get_interface<PPB_Fullscreen_Dev>()->SetFullscreen( - instance_->pp_instance(), BoolToPPBool(fullscreen))); + return PP_ToBool(get_interface<PPB_Fullscreen_Dev>()->SetFullscreen( + instance_->pp_instance(), PP_FromBool(fullscreen))); } bool Fullscreen_Dev::GetScreenSize(Size* size) { if (!has_interface<PPB_Fullscreen_Dev>()) return false; - return PPBoolToBool(get_interface<PPB_Fullscreen_Dev>()->GetScreenSize( + return PP_ToBool(get_interface<PPB_Fullscreen_Dev>()->GetScreenSize( instance_->pp_instance(), &size->pp_size())); } diff --git a/ppapi/cpp/dev/scrollbar_dev.cc b/ppapi/cpp/dev/scrollbar_dev.cc index 456190f..9ea2c14 100644 --- a/ppapi/cpp/dev/scrollbar_dev.cc +++ b/ppapi/cpp/dev/scrollbar_dev.cc @@ -6,7 +6,6 @@ #include "ppapi/cpp/dev/scrollbar_dev.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/module_impl.h" @@ -29,7 +28,7 @@ Scrollbar_Dev::Scrollbar_Dev(const Instance& instance, bool vertical) { if (!has_interface<PPB_Scrollbar_Dev>()) return; PassRefFromConstructor(get_interface<PPB_Scrollbar_Dev>()->Create( - instance.pp_instance(), BoolToPPBool(vertical))); + instance.pp_instance(), PP_FromBool(vertical))); } Scrollbar_Dev::Scrollbar_Dev(const Scrollbar_Dev& other) diff --git a/ppapi/cpp/dev/selection_dev.cc b/ppapi/cpp/dev/selection_dev.cc index f5c8cad..b086ac1 100644 --- a/ppapi/cpp/dev/selection_dev.cc +++ b/ppapi/cpp/dev/selection_dev.cc @@ -4,7 +4,6 @@ #include "ppapi/cpp/dev/selection_dev.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/var.h" @@ -21,7 +20,7 @@ PP_Var GetSelectedText(PP_Instance instance, PP_Bool html) { if (!object) return Var().Detach(); return static_cast<Selection_Dev*>(object)-> - GetSelectedText(PPBoolToBool(html)).Detach(); + GetSelectedText(PP_ToBool(html)).Detach(); } const PPP_Selection_Dev ppp_selection = { diff --git a/ppapi/cpp/dev/transport_dev.cc b/ppapi/cpp/dev/transport_dev.cc index cdbbd8c..b625a7d 100644 --- a/ppapi/cpp/dev/transport_dev.cc +++ b/ppapi/cpp/dev/transport_dev.cc @@ -32,7 +32,7 @@ Transport_Dev::Transport_Dev(Instance* instance, bool Transport_Dev::IsWritable() { if (!has_interface<PPB_Transport_Dev>()) return false; - return PPBoolToBool( + return PP_ToBool( get_interface<PPB_Transport_Dev>()->IsWritable(pp_resource())); } diff --git a/ppapi/cpp/dev/url_util_dev.cc b/ppapi/cpp/dev/url_util_dev.cc index dad5da16..3d07cb4 100644 --- a/ppapi/cpp/dev/url_util_dev.cc +++ b/ppapi/cpp/dev/url_util_dev.cc @@ -4,7 +4,6 @@ #include "ppapi/cpp/dev/url_util_dev.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" @@ -53,19 +52,19 @@ Var URLUtil_Dev::ResolveRelativeToDocument( bool URLUtil_Dev::IsSameSecurityOrigin(const Var& url_a, const Var& url_b) const { - return PPBoolToBool(interface_->IsSameSecurityOrigin(url_a.pp_var(), - url_b.pp_var())); + return PP_ToBool(interface_->IsSameSecurityOrigin(url_a.pp_var(), + url_b.pp_var())); } bool URLUtil_Dev::DocumentCanRequest(const Instance& instance, const Var& url) const { - return PPBoolToBool(interface_->DocumentCanRequest(instance.pp_instance(), - url.pp_var())); + return PP_ToBool(interface_->DocumentCanRequest(instance.pp_instance(), + url.pp_var())); } bool URLUtil_Dev::DocumentCanAccessDocument(const Instance& active, const Instance& target) const { - return PPBoolToBool( + return PP_ToBool( interface_->DocumentCanAccessDocument(active.pp_instance(), target.pp_instance())); } diff --git a/ppapi/cpp/dev/video_decoder_dev.cc b/ppapi/cpp/dev/video_decoder_dev.cc index 91e86d3..6e6a05a 100644 --- a/ppapi/cpp/dev/video_decoder_dev.cc +++ b/ppapi/cpp/dev/video_decoder_dev.cc @@ -7,12 +7,10 @@ #include "ppapi/c/dev/ppb_video_decoder_dev.h" #include "ppapi/c/dev/ppp_video_decoder_dev.h" #include "ppapi/c/pp_errors.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/dev/context_3d_dev.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/module_impl.h" -#include "ppapi/thunk/common.h" namespace pp { @@ -53,7 +51,7 @@ bool VideoDecoder_Dev::GetConfigs(Instance* instance, uint32_t* num_of_matching_configs) { if (!has_interface<PPB_VideoDecoder_Dev>()) return false; - return PPBoolToBool(get_interface<PPB_VideoDecoder_Dev>()->GetConfigs( + return PP_ToBool(get_interface<PPB_VideoDecoder_Dev>()->GetConfigs( instance->pp_instance(), prototype_config, matching_configs, matching_configs_size, num_of_matching_configs)); } diff --git a/ppapi/cpp/dev/widget_dev.cc b/ppapi/cpp/dev/widget_dev.cc index f69a873..ae28969 100644 --- a/ppapi/cpp/dev/widget_dev.cc +++ b/ppapi/cpp/dev/widget_dev.cc @@ -5,7 +5,6 @@ #include "ppapi/cpp/dev/widget_dev.h" #include "ppapi/c/dev/ppb_widget_dev.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/image_data.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" @@ -31,21 +30,21 @@ Widget_Dev::Widget_Dev(const Widget_Dev& other) : Resource(other) { bool Widget_Dev::Paint(const Rect& rect, ImageData* image) { if (!has_interface<PPB_Widget_Dev>()) return false; - return PPBoolToBool(get_interface<PPB_Widget_Dev>()->Paint( + return PP_ToBool(get_interface<PPB_Widget_Dev>()->Paint( pp_resource(), &rect.pp_rect(), image->pp_resource())); } bool Widget_Dev::HandleEvent(const PP_InputEvent& event) { if (!has_interface<PPB_Widget_Dev>()) return false; - return PPBoolToBool(get_interface<PPB_Widget_Dev>()->HandleEvent( + return PP_ToBool(get_interface<PPB_Widget_Dev>()->HandleEvent( pp_resource(), &event)); } bool Widget_Dev::GetLocation(Rect* location) { if (!has_interface<PPB_Widget_Dev>()) return false; - return PPBoolToBool(get_interface<PPB_Widget_Dev>()->GetLocation( + return PP_ToBool(get_interface<PPB_Widget_Dev>()->GetLocation( pp_resource(), &location->pp_rect())); } diff --git a/ppapi/cpp/dev/zoom_dev.cc b/ppapi/cpp/dev/zoom_dev.cc index 9451e9a..49a8cec 100644 --- a/ppapi/cpp/dev/zoom_dev.cc +++ b/ppapi/cpp/dev/zoom_dev.cc @@ -5,7 +5,6 @@ #include "ppapi/cpp/dev/zoom_dev.h" #include "ppapi/c/dev/ppb_zoom_dev.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/module_impl.h" @@ -23,8 +22,7 @@ void Zoom(PP_Instance instance, pp::Instance::GetPerInstanceObject(instance, kPPPZoomInterface); if (!object) return; - static_cast<Zoom_Dev*>(object)->Zoom(factor, - PPBoolToBool(text_only)); + static_cast<Zoom_Dev*>(object)->Zoom(factor, PP_ToBool(text_only)); } const PPP_Zoom_Dev ppp_zoom = { diff --git a/ppapi/cpp/graphics_2d.cc b/ppapi/cpp/graphics_2d.cc index 6a109f0..c0ea84e 100644 --- a/ppapi/cpp/graphics_2d.cc +++ b/ppapi/cpp/graphics_2d.cc @@ -6,7 +6,6 @@ #include "ppapi/c/pp_errors.h" #include "ppapi/c/ppb_graphics_2d.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/completion_callback.h" #include "ppapi/cpp/image_data.h" #include "ppapi/cpp/instance.h" @@ -42,7 +41,7 @@ Graphics2D::Graphics2D(Instance* instance, PassRefFromConstructor(get_interface<PPB_Graphics2D>()->Create( instance->pp_instance(), &size.pp_size(), - BoolToPPBool(is_always_opaque))); + PP_FromBool(is_always_opaque))); if (!is_null()) { // Only save the size if allocation succeeded. size_ = size; diff --git a/ppapi/cpp/image_data.cc b/ppapi/cpp/image_data.cc index 33178a6..5fcc4c3 100644 --- a/ppapi/cpp/image_data.cc +++ b/ppapi/cpp/image_data.cc @@ -8,7 +8,6 @@ #include <algorithm> -#include "ppapi/cpp/common.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/module_impl.h" @@ -55,7 +54,7 @@ ImageData::ImageData(Instance* instance, PassRefAndInitData(get_interface<PPB_ImageData>()->Create( instance->pp_instance(), format, &size.pp_size(), - BoolToPPBool(init_to_zero))); + PP_FromBool(init_to_zero))); } ImageData& ImageData::operator=(const ImageData& other) { diff --git a/ppapi/cpp/input_event.cc b/ppapi/cpp/input_event.cc index fe237cc..2417586 100644 --- a/ppapi/cpp/input_event.cc +++ b/ppapi/cpp/input_event.cc @@ -4,7 +4,6 @@ #include "ppapi/cpp/input_event.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/module_impl.h" diff --git a/ppapi/cpp/instance.cc b/ppapi/cpp/instance.cc index f4c8043..ea1e6d5 100644 --- a/ppapi/cpp/instance.cc +++ b/ppapi/cpp/instance.cc @@ -8,7 +8,6 @@ #include "ppapi/c/ppb_input_event.h" #include "ppapi/c/ppb_instance.h" #include "ppapi/c/ppb_messaging.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/dev/surface_3d_dev.h" #include "ppapi/cpp/graphics_2d.h" #include "ppapi/cpp/image_data.h" @@ -113,22 +112,21 @@ Var Instance::GetInstanceObject() { bool Instance::BindGraphics(const Graphics2D& graphics) { if (!has_interface<PPB_Instance>()) return false; - return PPBoolToBool(get_interface<PPB_Instance>()->BindGraphics( + return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics( pp_instance(), graphics.pp_resource())); } bool Instance::BindGraphics(const Surface3D_Dev& graphics) { if (!has_interface<PPB_Instance>()) return false; - return PPBoolToBool(get_interface<PPB_Instance>()->BindGraphics( + return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics( pp_instance(), graphics.pp_resource())); } bool Instance::IsFullFrame() { if (!has_interface<PPB_Instance>()) return false; - return PPBoolToBool(get_interface<PPB_Instance>()->IsFullFrame( - pp_instance())); + return PP_ToBool(get_interface<PPB_Instance>()->IsFullFrame(pp_instance())); } int32_t Instance::RequestInputEvents(uint32_t event_classes) { diff --git a/ppapi/cpp/module.cc b/ppapi/cpp/module.cc index 1610cea..412a38f 100644 --- a/ppapi/cpp/module.cc +++ b/ppapi/cpp/module.cc @@ -30,7 +30,6 @@ #include "ppapi/c/ppp_input_event.h" #include "ppapi/c/ppp_instance.h" #include "ppapi/c/ppp_messaging.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/input_event.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/rect.h" @@ -50,7 +49,7 @@ PP_Bool InputEvent_HandleEvent(PP_Instance pp_instance, PP_Resource resource) { if (!instance) return PP_FALSE; - return BoolToPPBool(instance->HandleInputEvent(InputEvent(resource))); + return PP_FromBool(instance->HandleInputEvent(InputEvent(resource))); } const PPP_InputEvent input_event_interface = { @@ -71,7 +70,7 @@ PP_Bool Instance_DidCreate(PP_Instance pp_instance, if (!instance) return PP_FALSE; module_singleton->current_instances_[pp_instance] = instance; - return BoolToPPBool(instance->Init(argc, argn, argv)); + return PP_FromBool(instance->Init(argc, argn, argv)); } void Instance_DidDestroy(PP_Instance instance) { @@ -108,7 +107,7 @@ void Instance_DidChangeFocus(PP_Instance pp_instance, PP_Bool has_focus) { Instance* instance = module_singleton->InstanceForPPInstance(pp_instance); if (!instance) return; - instance->DidChangeFocus(PPBoolToBool(has_focus)); + instance->DidChangeFocus(PP_ToBool(has_focus)); } PP_Bool Instance_HandleInputEvent(PP_Instance pp_instance, @@ -119,7 +118,7 @@ PP_Bool Instance_HandleInputEvent(PP_Instance pp_instance, Instance* instance = module_singleton->InstanceForPPInstance(pp_instance); if (!instance) return PP_FALSE; - return BoolToPPBool(instance->HandleInputEvent(*event)); + return PP_FromBool(instance->HandleInputEvent(*event)); } PP_Bool Instance_HandleDocumentLoad(PP_Instance pp_instance, @@ -130,8 +129,7 @@ PP_Bool Instance_HandleDocumentLoad(PP_Instance pp_instance, Instance* instance = module_singleton->InstanceForPPInstance(pp_instance); if (!instance) return PP_FALSE; - return BoolToPPBool( - instance->HandleDocumentLoad(URLLoader(pp_url_loader))); + return PP_FromBool(instance->HandleDocumentLoad(URLLoader(pp_url_loader))); } #ifndef PPAPI_INSTANCE_REMOVE_SCRIPTING diff --git a/ppapi/cpp/url_loader.cc b/ppapi/cpp/url_loader.cc index 65aa1f3..0a9db41 100644 --- a/ppapi/cpp/url_loader.cc +++ b/ppapi/cpp/url_loader.cc @@ -6,7 +6,6 @@ #include "ppapi/c/ppb_url_loader.h" #include "ppapi/c/pp_errors.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/completion_callback.h" #include "ppapi/cpp/dev/file_ref_dev.h" #include "ppapi/cpp/instance.h" @@ -66,7 +65,7 @@ bool URLLoader::GetUploadProgress(int64_t* bytes_sent, int64_t* total_bytes_to_be_sent) const { if (!has_interface<PPB_URLLoader>()) return false; - return PPBoolToBool(get_interface<PPB_URLLoader>()->GetUploadProgress( + return PP_ToBool(get_interface<PPB_URLLoader>()->GetUploadProgress( pp_resource(), bytes_sent, total_bytes_to_be_sent)); } @@ -75,9 +74,8 @@ bool URLLoader::GetDownloadProgress( int64_t* total_bytes_to_be_received) const { if (!has_interface<PPB_URLLoader>()) return false; - return PPBoolToBool( - get_interface<PPB_URLLoader>()->GetDownloadProgress( - pp_resource(), bytes_received, total_bytes_to_be_received)); + return PP_ToBool(get_interface<PPB_URLLoader>()->GetDownloadProgress( + pp_resource(), bytes_received, total_bytes_to_be_received)); } URLResponseInfo URLLoader::GetResponseInfo() const { diff --git a/ppapi/cpp/url_request_info.cc b/ppapi/cpp/url_request_info.cc index 1303d71..7054a909 100644 --- a/ppapi/cpp/url_request_info.cc +++ b/ppapi/cpp/url_request_info.cc @@ -4,7 +4,6 @@ #include "ppapi/cpp/url_request_info.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/dev/file_ref_dev.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" @@ -35,14 +34,14 @@ bool URLRequestInfo::SetProperty(PP_URLRequestProperty property, const Var& value) { if (!has_interface<PPB_URLRequestInfo>()) return false; - return PPBoolToBool(get_interface<PPB_URLRequestInfo>()->SetProperty( + return PP_ToBool(get_interface<PPB_URLRequestInfo>()->SetProperty( pp_resource(), property, value.pp_var())); } bool URLRequestInfo::AppendDataToBody(const void* data, uint32_t len) { if (!has_interface<PPB_URLRequestInfo>()) return false; - return PPBoolToBool(get_interface<PPB_URLRequestInfo>()->AppendDataToBody( + return PP_ToBool(get_interface<PPB_URLRequestInfo>()->AppendDataToBody( pp_resource(), data, len)); } @@ -50,7 +49,7 @@ bool URLRequestInfo::AppendFileToBody(const FileRef_Dev& file_ref, PP_Time expected_last_modified_time) { if (!has_interface<PPB_URLRequestInfo>()) return false; - return PPBoolToBool( + return PP_ToBool( get_interface<PPB_URLRequestInfo>()->AppendFileToBody( pp_resource(), file_ref.pp_resource(), @@ -66,13 +65,12 @@ bool URLRequestInfo::AppendFileRangeToBody( PP_Time expected_last_modified_time) { if (!has_interface<PPB_URLRequestInfo>()) return false; - return PPBoolToBool( - get_interface<PPB_URLRequestInfo>()->AppendFileToBody( - pp_resource(), - file_ref.pp_resource(), - start_offset, - length, - expected_last_modified_time)); + return PP_ToBool(get_interface<PPB_URLRequestInfo>()->AppendFileToBody( + pp_resource(), + file_ref.pp_resource(), + start_offset, + length, + expected_last_modified_time)); } } // namespace pp diff --git a/ppapi/cpp/var.cc b/ppapi/cpp/var.cc index 550f9be..b655e98 100644 --- a/ppapi/cpp/var.cc +++ b/ppapi/cpp/var.cc @@ -14,7 +14,6 @@ # include "ppapi/c/dev/ppb_var_deprecated.h" #endif #include "ppapi/c/ppb_var.h" -#include "ppapi/cpp/common.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/logging.h" #include "ppapi/cpp/module.h" @@ -70,7 +69,7 @@ Var::Var(Null) { Var::Var(bool b) { var_.type = PP_VARTYPE_BOOL; var_.padding = 0; - var_.value.as_bool = BoolToPPBool(b); + var_.value.as_bool = PP_FromBool(b); needs_release_ = false; } @@ -178,7 +177,7 @@ bool Var::AsBool() const { PP_NOTREACHED(); return false; } - return PPBoolToBool(var_.value.as_bool); + return PP_ToBool(var_.value.as_bool); } int32_t Var::AsInt() const { diff --git a/ppapi/proxy/host_dispatcher.cc b/ppapi/proxy/host_dispatcher.cc index 60c0cf7..1137a54 100644 --- a/ppapi/proxy/host_dispatcher.cc +++ b/ppapi/proxy/host_dispatcher.cc @@ -40,7 +40,7 @@ PP_Bool ReserveInstanceID(PP_Module module, PP_Instance instance) { bool usable = true; if (!found->second->Send(new PpapiMsg_ReserveInstanceId(instance, &usable))) return PP_TRUE; - return BoolToPPBool(usable); + return PP_FromBool(usable); } // Saves the state of the given bool and puts it back when it goes out of diff --git a/ppapi/proxy/interface_proxy.h b/ppapi/proxy/interface_proxy.h index d6f29cb..3b16f9e 100644 --- a/ppapi/proxy/interface_proxy.h +++ b/ppapi/proxy/interface_proxy.h @@ -72,14 +72,6 @@ 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_param_traits.cc b/ppapi/proxy/ppapi_param_traits.cc index 4c3d2fb..87c253b 100644 --- a/ppapi/proxy/ppapi_param_traits.cc +++ b/ppapi/proxy/ppapi_param_traits.cc @@ -78,7 +78,7 @@ void WriteVectorWithoutCopy(Message* m, const std::vector<T>& p) { // static void ParamTraits<PP_Bool>::Write(Message* m, const param_type& p) { - ParamTraits<bool>::Write(m, pp::proxy::PPBoolToBool(p)); + ParamTraits<bool>::Write(m, PP_ToBool(p)); } // static @@ -89,7 +89,7 @@ bool ParamTraits<PP_Bool>::Read(const Message* m, void** iter, param_type* r) { bool result = false; if (!ParamTraits<bool>::Read(m, iter, &result)) return false; - *r = pp::proxy::BoolToPPBool(result); + *r = PP_FromBool(result); return true; } diff --git a/ppapi/proxy/ppb_core_proxy.cc b/ppapi/proxy/ppb_core_proxy.cc index 23c3d0b..a67ce1d 100644 --- a/ppapi/proxy/ppb_core_proxy.cc +++ b/ppapi/proxy/ppb_core_proxy.cc @@ -65,7 +65,7 @@ void CallOnMainThread(int delay_in_ms, } PP_Bool IsMainThread() { - return BoolToPPBool(GetMainThreadMessageLoop()->BelongsToCurrentThread()); + return PP_FromBool(GetMainThreadMessageLoop()->BelongsToCurrentThread()); } const PPB_Core core_interface = { diff --git a/ppapi/proxy/ppb_flash_clipboard_proxy.cc b/ppapi/proxy/ppb_flash_clipboard_proxy.cc index efe1df3..8dc98ff 100644 --- a/ppapi/proxy/ppb_flash_clipboard_proxy.cc +++ b/ppapi/proxy/ppb_flash_clipboard_proxy.cc @@ -44,7 +44,7 @@ PP_Bool IsFormatAvailable(PP_Instance instance_id, static_cast<int>(clipboard_type), static_cast<int>(format), &result)); - return BoolToPPBool(result); + return PP_FromBool(result); } PP_Var ReadPlainText(PP_Instance instance_id, @@ -134,7 +134,7 @@ void PPB_Flash_Clipboard_Proxy::OnMsgIsFormatAvailable( int clipboard_type, int format, bool* result) { - *result = PPBoolToBool(ppb_flash_clipboard_target()->IsFormatAvailable( + *result = PP_ToBool(ppb_flash_clipboard_target()->IsFormatAvailable( instance_id, static_cast<PP_Flash_Clipboard_Type>(clipboard_type), static_cast<PP_Flash_Clipboard_Format>(format))); diff --git a/ppapi/proxy/ppb_flash_file_proxy.cc b/ppapi/proxy/ppb_flash_file_proxy.cc index d3c8ecc..7b6dc2d 100644 --- a/ppapi/proxy/ppb_flash_file_proxy.cc +++ b/ppapi/proxy/ppb_flash_file_proxy.cc @@ -482,7 +482,7 @@ int32_t GetModuleLocalDirContents(PP_Instance instance, char* name_copy = new char[source.name.size() + 1]; memcpy(name_copy, source.name.c_str(), source.name.size() + 1); dest->name = name_copy; - dest->is_dir = BoolToPPBool(source.is_dir); + dest->is_dir = PP_FromBool(source.is_dir); } return result; @@ -611,7 +611,7 @@ void PPB_Flash_File_ModuleLocal_Proxy::OnMsgGetDirContents( entries->resize(contents->count); for (int32_t i = 0; i < contents->count; i++) { (*entries)[i].name.assign(contents->entries[i].name); - (*entries)[i].is_dir = PPBoolToBool(contents->entries[i].is_dir); + (*entries)[i].is_dir = PP_ToBool(contents->entries[i].is_dir); } ppb_flash_file_module_local_target()->FreeDirContents(instance, contents); } diff --git a/ppapi/proxy/ppb_font_proxy.cc b/ppapi/proxy/ppb_font_proxy.cc index 6acfe5d..5d51599 100644 --- a/ppapi/proxy/ppb_font_proxy.cc +++ b/ppapi/proxy/ppb_font_proxy.cc @@ -33,8 +33,8 @@ bool PPTextRunToTextRun(const PP_TextRun_Dev* run, return false; output->text = *str; - output->rtl = PPBoolToBool(run->rtl); - output->override_direction = PPBoolToBool(run->override_direction); + output->rtl = PP_ToBool(run->rtl); + output->override_direction = PP_ToBool(run->override_direction); return true; } diff --git a/ppapi/proxy/ppb_var_deprecated_proxy.cc b/ppapi/proxy/ppb_var_deprecated_proxy.cc index 55eb08c..652bdc8 100644 --- a/ppapi/proxy/ppb_var_deprecated_proxy.cc +++ b/ppapi/proxy/ppb_var_deprecated_proxy.cc @@ -94,7 +94,7 @@ bool HasProperty(PP_Var var, SerializedVarSendInput(dispatcher, var), SerializedVarSendInput(dispatcher, name), &se, &result)); } - return PPBoolToBool(result); + return PP_ToBool(result); } bool HasMethod(PP_Var var, @@ -112,7 +112,7 @@ bool HasMethod(PP_Var var, SerializedVarSendInput(dispatcher, var), SerializedVarSendInput(dispatcher, name), &se, &result)); } - return PPBoolToBool(result); + return PP_ToBool(result); } PP_Var GetProperty(PP_Var var, @@ -251,7 +251,7 @@ bool IsInstanceOf(PP_Var var, class_int, &class_data_int, &result)); *ppp_class_data = reinterpret_cast<void*>(static_cast<intptr_t>(class_data_int)); - return PPBoolToBool(result); + return PP_ToBool(result); } PP_Var CreateObject(PP_Instance instance, @@ -393,7 +393,7 @@ void PPB_Var_Deprecated_Proxy::OnMsgHasProperty( SerializedVarOutParam exception, PP_Bool* result) { SetAllowPluginReentrancy(); - *result = BoolToPPBool(ppb_var_target()->HasProperty( + *result = PP_FromBool(ppb_var_target()->HasProperty( var.Get(dispatcher()), name.Get(dispatcher()), exception.OutParam(dispatcher()))); @@ -405,7 +405,7 @@ void PPB_Var_Deprecated_Proxy::OnMsgHasMethodDeprecated( SerializedVarOutParam exception, PP_Bool* result) { SetAllowPluginReentrancy(); - *result = BoolToPPBool(ppb_var_target()->HasMethod( + *result = PP_FromBool(ppb_var_target()->HasMethod( var.Get(dispatcher()), name.Get(dispatcher()), exception.OutParam(dispatcher()))); diff --git a/ppapi/proxy/serialized_var.cc b/ppapi/proxy/serialized_var.cc index 286f244..786cc9e 100644 --- a/ppapi/proxy/serialized_var.cc +++ b/ppapi/proxy/serialized_var.cc @@ -128,7 +128,7 @@ void SerializedVar::Inner::WriteToMessage(IPC::Message* m) const { // just serialized. break; case PP_VARTYPE_BOOL: - m->WriteBool(PPBoolToBool(var_.value.as_bool)); + m->WriteBool(PP_ToBool(var_.value.as_bool)); break; case PP_VARTYPE_INT32: m->WriteInt(var_.value.as_int); @@ -185,7 +185,7 @@ bool SerializedVar::Inner::ReadFromMessage(const IPC::Message* m, void** iter) { case PP_VARTYPE_BOOL: { bool bool_value; success = m->ReadBool(iter, &bool_value); - var_.value.as_bool = BoolToPPBool(bool_value); + var_.value.as_bool = PP_FromBool(bool_value); break; } case PP_VARTYPE_INT32: |