OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 6504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6515 } | 6515 } |
6516 | 6516 |
6517 static IntWrapper& threadSpecificIntWrapper() | 6517 static IntWrapper& threadSpecificIntWrapper() |
6518 { | 6518 { |
6519 DEFINE_THREAD_SAFE_STATIC_LOCAL( | 6519 DEFINE_THREAD_SAFE_STATIC_LOCAL( |
6520 ThreadSpecific<Persistent<IntWrapper>>, intWrapper, | 6520 ThreadSpecific<Persistent<IntWrapper>>, intWrapper, |
6521 new ThreadSpecific<Persistent<IntWrapper>>); | 6521 new ThreadSpecific<Persistent<IntWrapper>>); |
6522 Persistent<IntWrapper>& handle = *intWrapper; | 6522 Persistent<IntWrapper>& handle = *intWrapper; |
6523 if (!handle) { | 6523 if (!handle) { |
6524 handle = new IntWrapper(42); | 6524 handle = new IntWrapper(42); |
6525 handle.clearOnThreadShutdown(); | 6525 handle.registerAsStaticReference(); |
6526 } | 6526 } |
6527 return *handle; | 6527 return *handle; |
6528 } | 6528 } |
6529 }; | 6529 }; |
6530 | 6530 |
6531 } // namespace | 6531 } // namespace |
6532 | 6532 |
6533 TEST(HeapTest, TestClearOnShutdown) | 6533 TEST(HeapTest, TestClearOnShutdown) |
6534 { | 6534 { |
6535 ThreadedClearOnShutdownTester::test(); | 6535 ThreadedClearOnShutdownTester::test(); |
6536 } | 6536 } |
6537 | 6537 |
6538 } // namespace blink | 6538 } // namespace blink |
OLD | NEW |