| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 met: | 5 * modification, are permitted provided that the following conditions are met: |
| 6 * | 6 * |
| 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 23 matching lines...) Expand all Loading... |
| 34 #include "core/css/FontFaceSetLoadEvent.h" | 34 #include "core/css/FontFaceSetLoadEvent.h" |
| 35 #include "core/css/StylePropertySet.h" | 35 #include "core/css/StylePropertySet.h" |
| 36 #include "core/css/parser/CSSParser.h" | 36 #include "core/css/parser/CSSParser.h" |
| 37 #include "core/css/resolver/StyleResolver.h" | 37 #include "core/css/resolver/StyleResolver.h" |
| 38 #include "core/dom/Document.h" | 38 #include "core/dom/Document.h" |
| 39 #include "core/dom/StyleEngine.h" | 39 #include "core/dom/StyleEngine.h" |
| 40 #include "core/frame/FrameView.h" | 40 #include "core/frame/FrameView.h" |
| 41 #include "core/frame/LocalFrame.h" | 41 #include "core/frame/LocalFrame.h" |
| 42 #include "core/style/StyleInheritedData.h" | 42 #include "core/style/StyleInheritedData.h" |
| 43 #include "platform/Histogram.h" | 43 #include "platform/Histogram.h" |
| 44 #include "public/platform/Platform.h" | |
| 45 | 44 |
| 46 namespace blink { | 45 namespace blink { |
| 47 | 46 |
| 48 static const int defaultFontSize = 10; | 47 static const int defaultFontSize = 10; |
| 49 static const char defaultFontFamily[] = "sans-serif"; | 48 static const char defaultFontFamily[] = "sans-serif"; |
| 50 | 49 |
| 51 class LoadFontPromiseResolver final : public FontFace::LoadFontCallback { | 50 class LoadFontPromiseResolver final : public FontFace::LoadFontCallback { |
| 52 public: | 51 public: |
| 53 static PassRefPtrWillBeRawPtr<LoadFontPromiseResolver> create(FontFaceArray
faces, ScriptState* scriptState) | 52 static PassRefPtrWillBeRawPtr<LoadFontPromiseResolver> create(FontFaceArray
faces, ScriptState* scriptState) |
| 54 { | 53 { |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 } | 476 } |
| 478 | 477 |
| 479 void FontFaceSet::FontLoadHistogram::record() | 478 void FontFaceSet::FontLoadHistogram::record() |
| 480 { | 479 { |
| 481 if (!m_recorded) { | 480 if (!m_recorded) { |
| 482 m_recorded = true; | 481 m_recorded = true; |
| 483 DEFINE_STATIC_LOCAL(CustomCountHistogram, webFontsInPageHistogram, ("Web
Font.WebFontsInPage", 1, 100, 50)); | 482 DEFINE_STATIC_LOCAL(CustomCountHistogram, webFontsInPageHistogram, ("Web
Font.WebFontsInPage", 1, 100, 50)); |
| 484 webFontsInPageHistogram.count(m_count); | 483 webFontsInPageHistogram.count(m_count); |
| 485 } | 484 } |
| 486 if (m_status == HadBlankText || m_status == DidNotHaveBlankText) { | 485 if (m_status == HadBlankText || m_status == DidNotHaveBlankText) { |
| 487 Platform::current()->histogramEnumeration("WebFont.HadBlankText", m_stat
us == HadBlankText ? 1 : 0, 2); | 486 DEFINE_STATIC_LOCAL(EnumerationHistogram, hadBlankTextHistogram, ("WebFo
nt.HadBlankText", 2)); |
| 487 hadBlankTextHistogram.count(m_status == HadBlankText ? 1 : 0); |
| 488 m_status = Reported; | 488 m_status = Reported; |
| 489 } | 489 } |
| 490 } | 490 } |
| 491 | 491 |
| 492 static const char* supplementName() | 492 static const char* supplementName() |
| 493 { | 493 { |
| 494 return "FontFaceSet"; | 494 return "FontFaceSet"; |
| 495 } | 495 } |
| 496 | 496 |
| 497 PassRefPtrWillBeRawPtr<FontFaceSet> FontFaceSet::from(Document& document) | 497 PassRefPtrWillBeRawPtr<FontFaceSet> FontFaceSet::from(Document& document) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 visitor->trace(m_failedFonts); | 545 visitor->trace(m_failedFonts); |
| 546 visitor->trace(m_nonCSSConnectedFaces); | 546 visitor->trace(m_nonCSSConnectedFaces); |
| 547 visitor->trace(m_asyncRunner); | 547 visitor->trace(m_asyncRunner); |
| 548 HeapSupplement<Document>::trace(visitor); | 548 HeapSupplement<Document>::trace(visitor); |
| 549 #endif | 549 #endif |
| 550 EventTargetWithInlineData::trace(visitor); | 550 EventTargetWithInlineData::trace(visitor); |
| 551 ActiveDOMObject::trace(visitor); | 551 ActiveDOMObject::trace(visitor); |
| 552 } | 552 } |
| 553 | 553 |
| 554 } // namespace blink | 554 } // namespace blink |
| OLD | NEW |