| 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 6496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6507 } | 6507 } |
| 6508 | 6508 |
| 6509 static IntWrapper& threadSpecificIntWrapper() | 6509 static IntWrapper& threadSpecificIntWrapper() |
| 6510 { | 6510 { |
| 6511 DEFINE_THREAD_SAFE_STATIC_LOCAL( | 6511 DEFINE_THREAD_SAFE_STATIC_LOCAL( |
| 6512 ThreadSpecific<Persistent<IntWrapper>>, intWrapper, | 6512 ThreadSpecific<Persistent<IntWrapper>>, intWrapper, |
| 6513 new ThreadSpecific<Persistent<IntWrapper>>); | 6513 new ThreadSpecific<Persistent<IntWrapper>>); |
| 6514 Persistent<IntWrapper>& handle = *intWrapper; | 6514 Persistent<IntWrapper>& handle = *intWrapper; |
| 6515 if (!handle) { | 6515 if (!handle) { |
| 6516 handle = new IntWrapper(42); | 6516 handle = new IntWrapper(42); |
| 6517 handle.clearOnThreadShutdown(); | 6517 handle.registerAsStaticReference(); |
| 6518 } | 6518 } |
| 6519 return *handle; | 6519 return *handle; |
| 6520 } | 6520 } |
| 6521 }; | 6521 }; |
| 6522 | 6522 |
| 6523 } // namespace | 6523 } // namespace |
| 6524 | 6524 |
| 6525 TEST(HeapTest, TestClearOnShutdown) | 6525 TEST(HeapTest, TestClearOnShutdown) |
| 6526 { | 6526 { |
| 6527 ThreadedClearOnShutdownTester::test(); | 6527 ThreadedClearOnShutdownTester::test(); |
| 6528 } | 6528 } |
| 6529 | 6529 |
| 6530 } // namespace blink | 6530 } // namespace blink |
| OLD | NEW |