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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 1850413002: Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address compilation failure Created 4 years, 8 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) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 133 }
134 134
135 const char* boolString(bool val) 135 const char* boolString(bool val)
136 { 136 {
137 return val ? "true" : "false"; 137 return val ? "true" : "false";
138 } 138 }
139 #endif 139 #endif
140 140
141 DocumentElementSetMap& documentToElementSetMap() 141 DocumentElementSetMap& documentToElementSetMap()
142 { 142 {
143 DEFINE_STATIC_LOCAL(Persistent<DocumentElementSetMap>, map, (new DocumentEle mentSetMap())); 143 DEFINE_STATIC_LOCAL(DocumentElementSetMap, map, (new DocumentElementSetMap)) ;
144 return *map; 144 return map;
145 } 145 }
146 146
147 void addElementToDocumentMap(HTMLMediaElement* element, Document* document) 147 void addElementToDocumentMap(HTMLMediaElement* element, Document* document)
148 { 148 {
149 DocumentElementSetMap& map = documentToElementSetMap(); 149 DocumentElementSetMap& map = documentToElementSetMap();
150 WeakMediaElementSet set = map.take(document); 150 WeakMediaElementSet set = map.take(document);
151 set.add(element); 151 set.add(element);
152 map.add(document, set); 152 map.add(document, set);
153 } 153 }
154 154
(...skipping 3715 matching lines...) Expand 10 before | Expand all | Expand 10 after
3870 } 3870 }
3871 3871
3872 #if !ENABLE(OILPAN) 3872 #if !ENABLE(OILPAN)
3873 WeakPtr<HTMLMediaElement> HTMLMediaElement::createWeakPtr() 3873 WeakPtr<HTMLMediaElement> HTMLMediaElement::createWeakPtr()
3874 { 3874 {
3875 return m_weakPtrFactory.createWeakPtr(); 3875 return m_weakPtrFactory.createWeakPtr();
3876 } 3876 }
3877 #endif 3877 #endif
3878 3878
3879 } // namespace blink 3879 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLLinkElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLSourceElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698