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

Side by Side Diff: third_party/WebKit/Source/core/fetch/Resource.cpp

Issue 1491253004: Release Oilpan heap singletons prior to LSan leak detection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move static-local ref registration to wtf/LeakAnnotations.h Created 5 years 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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 if (nextPriority.visibility == ResourcePriority::NotVisible) 990 if (nextPriority.visibility == ResourcePriority::NotVisible)
991 continue; 991 continue;
992 priority.visibility = ResourcePriority::Visible; 992 priority.visibility = ResourcePriority::Visible;
993 priority.intraPriorityValue += nextPriority.intraPriorityValue; 993 priority.intraPriorityValue += nextPriority.intraPriorityValue;
994 } 994 }
995 return priority; 995 return priority;
996 } 996 }
997 997
998 Resource::ResourceCallback* Resource::ResourceCallback::callbackHandler() 998 Resource::ResourceCallback* Resource::ResourceCallback::callbackHandler()
999 { 999 {
1000 // Oilpan + LSan: as the callbackHandler() singleton is used by Resource
1001 // and ResourcePtr finalizers, it cannot be released upon shutdown in
1002 // preparation for leak detection.
1003 //
1004 // Keep it out of LSan's reach instead.
1005 LSAN_LEAK_SCOPE;
1000 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<ResourceCallback>, callbackHandle r, (adoptPtrWillBeNoop(new ResourceCallback))); 1006 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<ResourceCallback>, callbackHandle r, (adoptPtrWillBeNoop(new ResourceCallback)));
1001 return callbackHandler.get(); 1007 return callbackHandler.get();
1002 } 1008 }
1003 1009
1004 DEFINE_TRACE(Resource::ResourceCallback) 1010 DEFINE_TRACE(Resource::ResourceCallback)
1005 { 1011 {
1006 #if ENABLE(OILPAN) 1012 #if ENABLE(OILPAN)
1007 visitor->trace(m_resourcesWithPendingClients); 1013 visitor->trace(m_resourcesWithPendingClients);
1008 #endif 1014 #endif
1009 } 1015 }
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1153 return "ImportResource"; 1159 return "ImportResource";
1154 case Resource::Media: 1160 case Resource::Media:
1155 return "Media"; 1161 return "Media";
1156 } 1162 }
1157 ASSERT_NOT_REACHED(); 1163 ASSERT_NOT_REACHED();
1158 return "Unknown"; 1164 return "Unknown";
1159 } 1165 }
1160 #endif // !LOG_DISABLED 1166 #endif // !LOG_DISABLED
1161 1167
1162 } // namespace blink 1168 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698