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

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: generalize clearing 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 6504 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698