OLD | NEW |
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 #ifndef PPAPI_TESTS_TEST_UTILS_H_ | 5 #ifndef PPAPI_TESTS_TEST_UTILS_H_ |
6 #define PPAPI_TESTS_TEST_UTILS_H_ | 6 #define PPAPI_TESTS_TEST_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ppapi/c/dev/ppb_testing_dev.h" | 10 #include "ppapi/c/dev/ppb_testing_dev.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 static void Handler(void* user_data, int32_t result); | 42 static void Handler(void* user_data, int32_t result); |
43 | 43 |
44 bool have_result_; | 44 bool have_result_; |
45 int32_t result_; | 45 int32_t result_; |
46 bool force_async_; | 46 bool force_async_; |
47 bool post_quit_task_; | 47 bool post_quit_task_; |
48 unsigned run_count_; | 48 unsigned run_count_; |
49 PP_Instance instance_; | 49 PP_Instance instance_; |
50 }; | 50 }; |
51 | 51 |
| 52 // This is roughly copied from base/compiler_specific.h, and makes it possible |
| 53 // to pass 'this' in a constructor initializer list, when you really mean it. |
| 54 // |
| 55 // Example usage: |
| 56 // Foo::Foo(MyInstance* instance) |
| 57 // : ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) {} |
| 58 #if defined(COMPILER_MSVC) |
| 59 #define PP_ALLOW_THIS_IN_INITIALIZER_LIST(code) \ |
| 60 __pragma(warning(push)) \ |
| 61 __pragma(warning(disable:4355)) \ |
| 62 code \ |
| 63 __pragma(warning(pop)) |
| 64 #else |
| 65 #define PP_ALLOW_THIS_IN_INITIALIZER_LIST(code) code |
| 66 #endif |
| 67 |
52 #endif // PPAPI_TESTS_TEST_UTILS_H_ | 68 #endif // PPAPI_TESTS_TEST_UTILS_H_ |
OLD | NEW |