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

Unified Diff: Source/core/css/FontFace.cpp

Issue 699713003: IDL: ArrayBuffer and ArrayBufferView support for union types (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/css/FontFace.cpp
diff --git a/Source/core/css/FontFace.cpp b/Source/core/css/FontFace.cpp
index 29d02b3eb995f4190557d52c95c6b4666309d1cf..3fb3fb8aae6c7f51d3deda582cfd1f081204d7a3 100644
--- a/Source/core/css/FontFace.cpp
+++ b/Source/core/css/FontFace.cpp
@@ -33,6 +33,7 @@
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/ScriptState.h"
+#include "bindings/core/v8/UnionTypesCore.h"
#include "core/CSSValueKeywords.h"
#include "core/css/BinaryDataFontFaceSource.h"
#include "core/css/CSSFontFace.h"
@@ -68,6 +69,18 @@ static PassRefPtrWillBeRawPtr<CSSValue> parseCSSValue(const Document* document,
return CSSParser::parseSingleValue(propertyID, s, context);
}
+PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, StringOrArrayBufferOrArrayBufferView& source, const FontFaceDescriptors& descriptors)
+{
+ if (source.isString())
+ return create(context, family, source.getAsString(), descriptors);
+ if (source.isArrayBuffer())
+ return create(context, family, source.getAsArrayBuffer(), descriptors);
+ if (source.isArrayBufferView())
+ return create(context, family, source.getAsArrayBufferView(), descriptors);
+ ASSERT_NOT_REACHED();
+ return nullptr;
+}
+
PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicString& family, const String& source, const FontFaceDescriptors& descriptors)
{
RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(context, family, descriptors));

Powered by Google App Engine
This is Rietveld 408576698