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

Side by Side Diff: third_party/WebKit/Source/platform/heap/Handle.h

Issue 1962513002: Upon clearing, release PersistentNode of cross-thread-persistent also. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tidy 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/HeapTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 if (crossThreadnessConfiguration == CrossThreadPersistentConfiguration) 208 if (crossThreadnessConfiguration == CrossThreadPersistentConfiguration)
209 releaseStore(reinterpret_cast<void* volatile*>(&m_raw), ptr); 209 releaseStore(reinterpret_cast<void* volatile*>(&m_raw), ptr);
210 else 210 else
211 m_raw = ptr; 211 m_raw = ptr;
212 checkPointer(); 212 checkPointer();
213 if (m_raw) { 213 if (m_raw) {
214 if (!m_persistentNode) 214 if (!m_persistentNode)
215 initialize(); 215 initialize();
216 return; 216 return;
217 } 217 }
218 if (m_persistentNode && crossThreadnessConfiguration != CrossThreadPersi stentConfiguration) 218 uninitialize();
219 uninitialize();
220 } 219 }
221 220
222 NO_LAZY_SWEEP_SANITIZE_ADDRESS 221 NO_LAZY_SWEEP_SANITIZE_ADDRESS
223 void initialize() 222 void initialize()
224 { 223 {
225 ASSERT(!m_persistentNode); 224 ASSERT(!m_persistentNode);
226 if (!m_raw) 225 if (!m_raw)
227 return; 226 return;
228 227
229 TraceCallback traceCallback = TraceMethodDelegate<PersistentBase<T, weak nessConfiguration, crossThreadnessConfiguration>, &PersistentBase<T, weaknessCon figuration, crossThreadnessConfiguration>::trace>::trampoline; 228 TraceCallback traceCallback = TraceMethodDelegate<PersistentBase<T, weak nessConfiguration, crossThreadnessConfiguration>, &PersistentBase<T, weaknessCon figuration, crossThreadnessConfiguration>::trace>::trampoline;
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
1214 // into it. 1213 // into it.
1215 // 1214 //
1216 // TODO(sof): remove this hack once wtf/Functional.h can also work with a ty pe like 1215 // TODO(sof): remove this hack once wtf/Functional.h can also work with a ty pe like
1217 // CrossThreadWeakPersistent<>. 1216 // CrossThreadWeakPersistent<>.
1218 static WeakPtr<T> unwrap(const StorageType& value) { return WeakPtr<T>(WeakR eference<T>::create(value.get())); } 1217 static WeakPtr<T> unwrap(const StorageType& value) { return WeakPtr<T>(WeakR eference<T>::create(value.get())); }
1219 }; 1218 };
1220 1219
1221 } // namespace WTF 1220 } // namespace WTF
1222 1221
1223 #endif 1222 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/HeapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698