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

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

Issue 1805843002: [v8 gc] Introduce a base class for all objects that can have pending activity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 4 years, 9 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) 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 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 && fontFace->setPropertyFromStyle(properties, CSSPropertyFontDisplay) 131 && fontFace->setPropertyFromStyle(properties, CSSPropertyFontDisplay)
132 && !fontFace->family().isEmpty() 132 && !fontFace->family().isEmpty()
133 && fontFace->traits().bitfield()) { 133 && fontFace->traits().bitfield()) {
134 fontFace->initCSSFontFace(document, src); 134 fontFace->initCSSFontFace(document, src);
135 return fontFace.release(); 135 return fontFace.release();
136 } 136 }
137 return nullptr; 137 return nullptr;
138 } 138 }
139 139
140 FontFace::FontFace(ExecutionContext* context) 140 FontFace::FontFace(ExecutionContext* context)
141 : ActiveDOMObject(context) 141 : ActiveScriptWrappable(this)
142 , ActiveDOMObject(context)
142 , m_status(Unloaded) 143 , m_status(Unloaded)
143 { 144 {
144 suspendIfNeeded(); 145 suspendIfNeeded();
145 } 146 }
146 147
147 FontFace::FontFace(ExecutionContext* context, const AtomicString& family, const FontFaceDescriptors& descriptors) 148 FontFace::FontFace(ExecutionContext* context, const AtomicString& family, const FontFaceDescriptors& descriptors)
148 : ActiveDOMObject(context) 149 : ActiveScriptWrappable(this)
150 , ActiveDOMObject(context)
149 , m_family(family) 151 , m_family(family)
150 , m_status(Unloaded) 152 , m_status(Unloaded)
151 { 153 {
152 Document* document = toDocument(context); 154 Document* document = toDocument(context);
153 setPropertyFromString(document, descriptors.style(), CSSPropertyFontStyle); 155 setPropertyFromString(document, descriptors.style(), CSSPropertyFontStyle);
154 setPropertyFromString(document, descriptors.weight(), CSSPropertyFontWeight) ; 156 setPropertyFromString(document, descriptors.weight(), CSSPropertyFontWeight) ;
155 setPropertyFromString(document, descriptors.stretch(), CSSPropertyFontStretc h); 157 setPropertyFromString(document, descriptors.stretch(), CSSPropertyFontStretc h);
156 setPropertyFromString(document, descriptors.unicodeRange(), CSSPropertyUnico deRange); 158 setPropertyFromString(document, descriptors.unicodeRange(), CSSPropertyUnico deRange);
157 setPropertyFromString(document, descriptors.variant(), CSSPropertyFontVarian t); 159 setPropertyFromString(document, descriptors.variant(), CSSPropertyFontVarian t);
158 setPropertyFromString(document, descriptors.featureSettings(), CSSPropertyFo ntFeatureSettings); 160 setPropertyFromString(document, descriptors.featureSettings(), CSSPropertyFo ntFeatureSettings);
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 { 645 {
644 return m_cssFontFace->hadBlankText(); 646 return m_cssFontFace->hadBlankText();
645 } 647 }
646 648
647 bool FontFace::hasPendingActivity() const 649 bool FontFace::hasPendingActivity() const
648 { 650 {
649 return m_status == Loading && getExecutionContext() && !getExecutionContext( )->activeDOMObjectsAreStopped(); 651 return m_status == Loading && getExecutionContext() && !getExecutionContext( )->activeDOMObjectsAreStopped();
650 } 652 }
651 653
652 } // namespace blink 654 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698