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

Side by Side Diff: third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp

Issue 1889973002: Refactoring starting a resource load (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/RemoteFontFaceSource.h" 5 #include "core/css/RemoteFontFaceSource.h"
6 6
7 #include "core/css/CSSCustomFontData.h" 7 #include "core/css/CSSCustomFontData.h"
8 #include "core/css/CSSFontFace.h" 8 #include "core/css/CSSFontFace.h"
9 #include "core/css/CSSFontSelector.h" 9 #include "core/css/CSSFontSelector.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
11 #include "core/fetch/ResourceFetcher.h"
11 #include "core/inspector/ConsoleMessage.h" 12 #include "core/inspector/ConsoleMessage.h"
12 #include "core/page/NetworkStateNotifier.h" 13 #include "core/page/NetworkStateNotifier.h"
13 #include "platform/Histogram.h" 14 #include "platform/Histogram.h"
14 #include "platform/RuntimeEnabledFeatures.h" 15 #include "platform/RuntimeEnabledFeatures.h"
15 #include "platform/fonts/FontCache.h" 16 #include "platform/fonts/FontCache.h"
16 #include "platform/fonts/FontDescription.h" 17 #include "platform/fonts/FontDescription.h"
17 #include "platform/fonts/SimpleFontData.h" 18 #include "platform/fonts/SimpleFontData.h"
18 #include "wtf/CurrentTime.h" 19 #include "wtf/CurrentTime.h"
19 20
20 namespace blink { 21 namespace blink {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 ASSERT_NOT_REACHED(); 165 ASSERT_NOT_REACHED();
165 return nullptr; 166 return nullptr;
166 } 167 }
167 RefPtr<CSSCustomFontData> cssFontData = CSSCustomFontData::create(this, m_pe riod == BlockPeriod ? CSSCustomFontData::InvisibleFallback : CSSCustomFontData:: VisibleFallback); 168 RefPtr<CSSCustomFontData> cssFontData = CSSCustomFontData::create(this, m_pe riod == BlockPeriod ? CSSCustomFontData::InvisibleFallback : CSSCustomFontData:: VisibleFallback);
168 return SimpleFontData::create(temporaryFont->platformData(), cssFontData); 169 return SimpleFontData::create(temporaryFont->platformData(), cssFontData);
169 } 170 }
170 171
171 void RemoteFontFaceSource::beginLoadIfNeeded() 172 void RemoteFontFaceSource::beginLoadIfNeeded()
172 { 173 {
173 if (m_fontSelector->document() && m_font->stillNeedsLoad()) { 174 if (m_fontSelector->document() && m_font->stillNeedsLoad()) {
174 m_font->load(m_fontSelector->document()->fetcher()); 175 m_fontSelector->document()->fetcher()->startLoad(m_font);
175 m_histograms.loadStarted(); 176 m_histograms.loadStarted();
176 } 177 }
177 m_font->startLoadLimitTimersIfNeeded(); 178 m_font->startLoadLimitTimersIfNeeded();
178 179
179 if (m_face) 180 if (m_face)
180 m_face->didBeginLoad(); 181 m_face->didBeginLoad();
181 } 182 }
182 183
183 DEFINE_TRACE(RemoteFontFaceSource) 184 DEFINE_TRACE(RemoteFontFaceSource)
184 { 185 {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 interventionResult |= 1 << 0; 284 interventionResult |= 1 << 0;
284 if (triggered) 285 if (triggered)
285 interventionResult |= 1 << 1; 286 interventionResult |= 1 << 1;
286 const int boundary = 1 << 2; 287 const int boundary = 1 << 2;
287 288
288 DEFINE_STATIC_LOCAL(EnumerationHistogram, interventionHistogram, ("WebFont.I nterventionResult", boundary)); 289 DEFINE_STATIC_LOCAL(EnumerationHistogram, interventionHistogram, ("WebFont.I nterventionResult", boundary));
289 interventionHistogram.count(interventionResult); 290 interventionHistogram.count(interventionResult);
290 } 291 }
291 292
292 } // namespace blink 293 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698