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

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

Issue 2694283003: Annotate ScriptWrappable-embedding singletons.
Patch Set: add XPathValue singleton Created 3 years, 10 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 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 if (url.getString().length() < maximumURLLengthForLogging) 143 if (url.getString().length() < maximumURLLengthForLogging)
144 return url.getString(); 144 return url.getString();
145 return url.getString().substring(0, maximumURLLengthForLogging) + "..."; 145 return url.getString().substring(0, maximumURLLengthForLogging) + "...";
146 } 146 }
147 147
148 const char* boolString(bool val) { 148 const char* boolString(bool val) {
149 return val ? "true" : "false"; 149 return val ? "true" : "false";
150 } 150 }
151 151
152 DocumentElementSetMap& documentToElementSetMap() { 152 DocumentElementSetMap& documentToElementSetMap() {
153 ALLOW_UNSAFE_SINGLETON()
153 DEFINE_STATIC_LOCAL(DocumentElementSetMap, map, (new DocumentElementSetMap)); 154 DEFINE_STATIC_LOCAL(DocumentElementSetMap, map, (new DocumentElementSetMap));
154 return map; 155 return map;
155 } 156 }
156 157
157 void addElementToDocumentMap(HTMLMediaElement* element, Document* document) { 158 void addElementToDocumentMap(HTMLMediaElement* element, Document* document) {
158 DocumentElementSetMap& map = documentToElementSetMap(); 159 DocumentElementSetMap& map = documentToElementSetMap();
159 WeakMediaElementSet* set = nullptr; 160 WeakMediaElementSet* set = nullptr;
160 auto it = map.find(document); 161 auto it = map.find(document);
161 if (it == map.end()) { 162 if (it == map.end()) {
162 set = new WeakMediaElementSet; 163 set = new WeakMediaElementSet;
(...skipping 3963 matching lines...) Expand 10 before | Expand all | Expand 10 after
4126 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); 4127 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE);
4127 } 4128 }
4128 4129
4129 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { 4130 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) {
4130 m_mostlyFillingViewport = true; 4131 m_mostlyFillingViewport = true;
4131 if (m_webMediaPlayer) 4132 if (m_webMediaPlayer)
4132 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); 4133 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport);
4133 } 4134 }
4134 4135
4135 } // namespace blink 4136 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698