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

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 1ba1c37be97857a0af5a58294172928398765e58..7f796f7a077402c5117058ee62aa18834688d41c 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"
@@ -4934,7 +4935,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));
@@ -4943,9 +4944,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