| OLD | NEW |
| 1 // Copyright (c) 2012 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 "ppapi/tests/test_broker.h" | 5 #include "ppapi/tests/test_broker.h" |
| 6 | 6 |
| 7 #if defined(_MSC_VER) | 7 #if defined(_MSC_VER) |
| 8 #define OS_WIN 1 | 8 #define OS_WIN 1 |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #else | 10 #else |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
| 54 return reinterpret_cast<HANDLE>(static_cast<intptr_t>(handle)); | 54 return reinterpret_cast<HANDLE>(static_cast<intptr_t>(handle)); |
| 55 #elif defined(OS_POSIX) | 55 #elif defined(OS_POSIX) |
| 56 return handle; | 56 return handle; |
| 57 #endif | 57 #endif |
| 58 } | 58 } |
| 59 | 59 |
| 60 #if defined(OS_POSIX) | 60 #if defined(OS_POSIX) |
| 61 | 61 |
| 62 #define HANDLE_EINTR(x) ({ \ | 62 #define HANDLE_EINTR(x) ({ \ |
| 63 typeof(x) eintr_wrapper_result; \ | 63 decltype(x) eintr_wrapper_result; \ |
| 64 do { \ | 64 do { \ |
| 65 eintr_wrapper_result = (x); \ | 65 eintr_wrapper_result = (x); \ |
| 66 } while (eintr_wrapper_result == -1 && errno == EINTR); \ | 66 } while (eintr_wrapper_result == -1 && errno == EINTR); \ |
| 67 eintr_wrapper_result; \ | 67 eintr_wrapper_result; \ |
| 68 }) | 68 }) |
| 69 | 69 |
| 70 #define IGNORE_EINTR(x) ({ \ | 70 #define IGNORE_EINTR(x) ({ \ |
| 71 typeof(x) eintr_wrapper_result; \ | 71 decltype(x) eintr_wrapper_result; \ |
| 72 do { \ | 72 do { \ |
| 73 eintr_wrapper_result = (x); \ | 73 eintr_wrapper_result = (x); \ |
| 74 if (eintr_wrapper_result == -1 && errno == EINTR) { \ | 74 if (eintr_wrapper_result == -1 && errno == EINTR) { \ |
| 75 eintr_wrapper_result = 0; \ | 75 eintr_wrapper_result = 0; \ |
| 76 } \ | 76 } \ |
| 77 } while (0); \ | 77 } while (0); \ |
| 78 eintr_wrapper_result; \ | 78 eintr_wrapper_result; \ |
| 79 }) | 79 }) |
| 80 | 80 |
| 81 #endif | 81 #endif |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 } | 343 } |
| 344 | 344 |
| 345 std::string TestBroker::TestIsAllowedPermissionGranted() { | 345 std::string TestBroker::TestIsAllowedPermissionGranted() { |
| 346 PP_Resource broker = broker_interface_->CreateTrusted( | 346 PP_Resource broker = broker_interface_->CreateTrusted( |
| 347 instance_->pp_instance()); | 347 instance_->pp_instance()); |
| 348 ASSERT_TRUE(broker); | 348 ASSERT_TRUE(broker); |
| 349 ASSERT_EQ(PP_TRUE, broker_interface_->IsAllowed(broker)); | 349 ASSERT_EQ(PP_TRUE, broker_interface_->IsAllowed(broker)); |
| 350 | 350 |
| 351 PASS(); | 351 PASS(); |
| 352 } | 352 } |
| OLD | NEW |