Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Side by Side Diff: third_party/WebKit/Source/platform/heap/HeapTest.cpp

Issue 1919663002: Unify and generalize thread static persistent finalization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Handle.h ('k') | third_party/WebKit/Source/platform/heap/PersistentNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698