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

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

Issue 606653006: bindings: Adds DOMArrayBuffer, etc. as thin wrappers for ArrayBuffer, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/FontFace.h ('k') | Source/core/dom/ArrayBuffer.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 29 matching lines...) Expand all
40 #include "core/css/CSSFontSelector.h" 40 #include "core/css/CSSFontSelector.h"
41 #include "core/css/CSSPrimitiveValue.h" 41 #include "core/css/CSSPrimitiveValue.h"
42 #include "core/css/CSSUnicodeRangeValue.h" 42 #include "core/css/CSSUnicodeRangeValue.h"
43 #include "core/css/CSSValueList.h" 43 #include "core/css/CSSValueList.h"
44 #include "core/css/FontFaceDescriptors.h" 44 #include "core/css/FontFaceDescriptors.h"
45 #include "core/css/LocalFontFaceSource.h" 45 #include "core/css/LocalFontFaceSource.h"
46 #include "core/css/RemoteFontFaceSource.h" 46 #include "core/css/RemoteFontFaceSource.h"
47 #include "core/css/StylePropertySet.h" 47 #include "core/css/StylePropertySet.h"
48 #include "core/css/StyleRule.h" 48 #include "core/css/StyleRule.h"
49 #include "core/css/parser/CSSParser.h" 49 #include "core/css/parser/CSSParser.h"
50 #include "core/dom/DOMArrayBuffer.h"
51 #include "core/dom/DOMArrayBufferView.h"
50 #include "core/dom/DOMException.h" 52 #include "core/dom/DOMException.h"
51 #include "core/dom/Document.h" 53 #include "core/dom/Document.h"
52 #include "core/dom/ExceptionCode.h" 54 #include "core/dom/ExceptionCode.h"
53 #include "core/dom/StyleEngine.h" 55 #include "core/dom/StyleEngine.h"
54 #include "core/frame/LocalFrame.h" 56 #include "core/frame/LocalFrame.h"
55 #include "core/frame/Settings.h" 57 #include "core/frame/Settings.h"
56 #include "core/frame/UseCounter.h" 58 #include "core/frame/UseCounter.h"
57 #include "core/svg/SVGFontFaceElement.h" 59 #include "core/svg/SVGFontFaceElement.h"
58 #include "core/svg/SVGFontFaceSource.h" 60 #include "core/svg/SVGFontFaceSource.h"
59 #include "core/svg/SVGRemoteFontFaceSource.h" 61 #include "core/svg/SVGRemoteFontFaceSource.h"
(...skipping 14 matching lines...) Expand all
74 RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(cont ext, family, descriptors)); 76 RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(cont ext, family, descriptors));
75 77
76 RefPtrWillBeRawPtr<CSSValue> src = parseCSSValue(toDocument(context), source , CSSPropertySrc); 78 RefPtrWillBeRawPtr<CSSValue> src = parseCSSValue(toDocument(context), source , CSSPropertySrc);
77 if (!src || !src->isValueList()) 79 if (!src || !src->isValueList())
78 fontFace->setError(DOMException::create(SyntaxError, "The source provide d ('" + source + "') could not be parsed as a value list.")); 80 fontFace->setError(DOMException::create(SyntaxError, "The source provide d ('" + source + "') could not be parsed as a value list."));
79 81
80 fontFace->initCSSFontFace(toDocument(context), src); 82 fontFace->initCSSFontFace(toDocument(context), src);
81 return fontFace.release(); 83 return fontFace.release();
82 } 84 }
83 85
84 PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, con st AtomicString& family, PassRefPtr<ArrayBuffer> source, const FontFaceDescripto rs& descriptors) 86 PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, con st AtomicString& family, PassRefPtr<DOMArrayBuffer> source, const FontFaceDescri ptors& descriptors)
85 { 87 {
86 RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(cont ext, family, descriptors)); 88 RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(cont ext, family, descriptors));
87 fontFace->initCSSFontFace(static_cast<const unsigned char*>(source->data()), source->byteLength()); 89 fontFace->initCSSFontFace(static_cast<const unsigned char*>(source->data()), source->byteLength());
88 return fontFace.release(); 90 return fontFace.release();
89 } 91 }
90 92
91 PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, con st AtomicString& family, PassRefPtr<ArrayBufferView> source, const FontFaceDescr iptors& descriptors) 93 PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, con st AtomicString& family, PassRefPtr<DOMArrayBufferView> source, const FontFaceDe scriptors& descriptors)
92 { 94 {
93 RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(cont ext, family, descriptors)); 95 RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(cont ext, family, descriptors));
94 fontFace->initCSSFontFace(static_cast<const unsigned char*>(source->baseAddr ess()), source->byteLength()); 96 fontFace->initCSSFontFace(static_cast<const unsigned char*>(source->baseAddr ess()), source->byteLength());
95 return fontFace.release(); 97 return fontFace.release();
96 } 98 }
97 99
98 PassRefPtrWillBeRawPtr<FontFace> FontFace::create(Document* document, const Styl eRuleFontFace* fontFaceRule) 100 PassRefPtrWillBeRawPtr<FontFace> FontFace::create(Document* document, const Styl eRuleFontFace* fontFaceRule)
99 { 101 {
100 const StylePropertySet& properties = fontFaceRule->properties(); 102 const StylePropertySet& properties = fontFaceRule->properties();
101 103
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 { 595 {
594 return m_cssFontFace->hadBlankText(); 596 return m_cssFontFace->hadBlankText();
595 } 597 }
596 598
597 bool FontFace::hasPendingActivity() const 599 bool FontFace::hasPendingActivity() const
598 { 600 {
599 return m_status == Loading && executionContext() && !executionContext()->act iveDOMObjectsAreStopped(); 601 return m_status == Loading && executionContext() && !executionContext()->act iveDOMObjectsAreStopped();
600 } 602 }
601 603
602 } // namespace blink 604 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/FontFace.h ('k') | Source/core/dom/ArrayBuffer.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698