From 48f0d6c7eb38d0f89aa300bafbfc2064ccc6cb9d Mon Sep 17 00:00:00 2001 From: "dmichael@chromium.org" Date: Fri, 6 Jun 2014 20:37:44 +0000 Subject: PPAPI: Remove PP_ALLOW_THIS_IN_INITIALIZER_LIST BUG=380827 Review URL: https://codereview.chromium.org/324453003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275514 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/api/pp_macros.idl | 16 ---------------- ppapi/c/pp_macros.h | 16 ---------------- ppapi/tests/test_flash.cc | 2 +- ppapi/tests/test_flash_drm.cc | 2 +- ppapi/tests/test_flash_message_loop.cc | 2 +- ppapi/tests/test_message_loop.cc | 2 +- ppapi/utility/websocket/websocket_api.cc | 4 ++-- 7 files changed, 6 insertions(+), 38 deletions(-) diff --git a/ppapi/api/pp_macros.idl b/ppapi/api/pp_macros.idl index 999da67..9f02c27 100644 --- a/ppapi/api/pp_macros.idl +++ b/ppapi/api/pp_macros.idl @@ -86,22 +86,6 @@ PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, struct NAME, SIZE) #define PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(NAME, SIZE) \ PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, enum NAME, SIZE) -/* This is roughly copied from base/compiler_specific.h, and makes it possible - to pass 'this' in a constructor initializer list, when you really mean it. - E.g.: - Foo::Foo(MyInstance* instance) - : PP_ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) {} - */ -#if defined(_MSC_VER) -# define PP_ALLOW_THIS_IN_INITIALIZER_LIST(code) \ - __pragma(warning(push)) \ - __pragma(warning(disable:4355)) \ - code \ - __pragma(warning(pop)) -#else -# define PP_ALLOW_THIS_IN_INITIALIZER_LIST(code) code -#endif - /** * @} * End of addtogroup PP diff --git a/ppapi/c/pp_macros.h b/ppapi/c/pp_macros.h index 910ac4c..31d7297 100644 --- a/ppapi/c/pp_macros.h +++ b/ppapi/c/pp_macros.h @@ -95,22 +95,6 @@ PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, struct NAME, SIZE) #define PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(NAME, SIZE) \ PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, enum NAME, SIZE) -/* This is roughly copied from base/compiler_specific.h, and makes it possible - to pass 'this' in a constructor initializer list, when you really mean it. - E.g.: - Foo::Foo(MyInstance* instance) - : PP_ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) {} - */ -#if defined(_MSC_VER) -# define PP_ALLOW_THIS_IN_INITIALIZER_LIST(code) \ - __pragma(warning(push)) \ - __pragma(warning(disable:4355)) \ - code \ - __pragma(warning(pop)) -#else -# define PP_ALLOW_THIS_IN_INITIALIZER_LIST(code) code -#endif - /** * @} * End of addtogroup PP diff --git a/ppapi/tests/test_flash.cc b/ppapi/tests/test_flash.cc index bb999fd..c854de5 100644 --- a/ppapi/tests/test_flash.cc +++ b/ppapi/tests/test_flash.cc @@ -19,7 +19,7 @@ using pp::Var; TestFlash::TestFlash(TestingInstance* instance) : TestCase(instance), - PP_ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) { + callback_factory_(this) { } void TestFlash::RunTests(const std::string& filter) { diff --git a/ppapi/tests/test_flash_drm.cc b/ppapi/tests/test_flash_drm.cc index 7fade64..8daf18d 100644 --- a/ppapi/tests/test_flash_drm.cc +++ b/ppapi/tests/test_flash_drm.cc @@ -32,7 +32,7 @@ namespace { TestFlashDRM::TestFlashDRM(TestingInstance* instance) : TestCase(instance), - PP_ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) { + callback_factory_(this) { } void TestFlashDRM::RunTests(const std::string& filter) { diff --git a/ppapi/tests/test_flash_message_loop.cc b/ppapi/tests/test_flash_message_loop.cc index f5dd3b8a..e7cb318 100644 --- a/ppapi/tests/test_flash_message_loop.cc +++ b/ppapi/tests/test_flash_message_loop.cc @@ -16,7 +16,7 @@ REGISTER_TEST_CASE(FlashMessageLoop); TestFlashMessageLoop::TestFlashMessageLoop(TestingInstance* instance) : TestCase(instance), message_loop_(NULL), - PP_ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) { + callback_factory_(this) { } TestFlashMessageLoop::~TestFlashMessageLoop() { diff --git a/ppapi/tests/test_message_loop.cc b/ppapi/tests/test_message_loop.cc index 475d9b2..31ef4b7 100644 --- a/ppapi/tests/test_message_loop.cc +++ b/ppapi/tests/test_message_loop.cc @@ -17,7 +17,7 @@ REGISTER_TEST_CASE(MessageLoop); TestMessageLoop::TestMessageLoop(TestingInstance* instance) : TestCase(instance), param_(kInvalid), - PP_ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)), + callback_factory_(this), main_loop_task_ran_(instance->pp_instance()) { } diff --git a/ppapi/utility/websocket/websocket_api.cc b/ppapi/utility/websocket/websocket_api.cc index c251539..82a320e 100644 --- a/ppapi/utility/websocket/websocket_api.cc +++ b/ppapi/utility/websocket/websocket_api.cc @@ -24,7 +24,7 @@ class WebSocketAPI::Implement : public WebSocket { Implement(Instance* instance, WebSocketAPI* api) : WebSocket(instance), api_(api), - callback_factory_(PP_ALLOW_THIS_IN_INITIALIZER_LIST(this)) { + callback_factory_(this) { } virtual ~Implement() {} @@ -104,7 +104,7 @@ class WebSocketAPI::Implement : public WebSocket { }; WebSocketAPI::WebSocketAPI(Instance* instance) - : impl_(new Implement(instance, PP_ALLOW_THIS_IN_INITIALIZER_LIST(this))) { + : impl_(new Implement(instance, this)) { } WebSocketAPI::~WebSocketAPI() { -- cgit v1.1