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

Unified Diff: Source/core/dom/Document.cpp

Issue 680193003: IDL: Generate union type containers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 3d9b2ff48daa51b26d54f977f31b9b48e03af427..d9973c2d86cf2b4bc9b8693edb4855524db8a4b0 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -34,6 +34,7 @@
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/ExceptionStatePlaceholder.h"
#include "bindings/core/v8/ScriptController.h"
+#include "bindings/core/v8/UnionTypesCore.h"
#include "bindings/core/v8/V8DOMWrapper.h"
#include "bindings/core/v8/WindowProxy.h"
#include "core/HTMLElementFactory.h"
@@ -4941,7 +4942,7 @@ void Document::detachRange(Range* range)
m_ranges.remove(range);
}
-void Document::getCSSCanvasContext(const String& type, const String& name, int width, int height, RefPtrWillBeRawPtr<CanvasRenderingContext2D>& context2d, RefPtrWillBeRawPtr<WebGLRenderingContext>& context3d)
+void Document::getCSSCanvasContext(const String& type, const String& name, int width, int height, CanvasRenderingContext2DOrWebGLRenderingContext& returnValue)
{
HTMLCanvasElement& element = getCSSCanvasElement(name);
element.setSize(IntSize(width, height));
@@ -4950,9 +4951,9 @@ void Document::getCSSCanvasContext(const String& type, const String& name, int w
return;
if (context->is2d()) {
- context2d = toCanvasRenderingContext2D(context);
+ returnValue.setCanvasRenderingContext2D(toCanvasRenderingContext2D(context));
} else if (context->is3d()) {
- context3d = toWebGLRenderingContext(context);
+ returnValue.setWebGLRenderingContext(toWebGLRenderingContext(context));
}
}

Powered by Google App Engine
This is Rietveld 408576698