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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 16 matching lines...) Expand all
27 27
28 #include "config.h" 28 #include "config.h"
29 #include "core/dom/Document.h" 29 #include "core/dom/Document.h"
30 30
31 #include "bindings/core/v8/CustomElementConstructorBuilder.h" 31 #include "bindings/core/v8/CustomElementConstructorBuilder.h"
32 #include "bindings/core/v8/DOMDataStore.h" 32 #include "bindings/core/v8/DOMDataStore.h"
33 #include "bindings/core/v8/ExceptionMessages.h" 33 #include "bindings/core/v8/ExceptionMessages.h"
34 #include "bindings/core/v8/ExceptionState.h" 34 #include "bindings/core/v8/ExceptionState.h"
35 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 35 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
36 #include "bindings/core/v8/ScriptController.h" 36 #include "bindings/core/v8/ScriptController.h"
37 #include "bindings/core/v8/UnionTypesCore.h"
37 #include "bindings/core/v8/V8DOMWrapper.h" 38 #include "bindings/core/v8/V8DOMWrapper.h"
38 #include "bindings/core/v8/WindowProxy.h" 39 #include "bindings/core/v8/WindowProxy.h"
39 #include "core/HTMLElementFactory.h" 40 #include "core/HTMLElementFactory.h"
40 #include "core/HTMLNames.h" 41 #include "core/HTMLNames.h"
41 #include "core/SVGElementFactory.h" 42 #include "core/SVGElementFactory.h"
42 #include "core/SVGNames.h" 43 #include "core/SVGNames.h"
43 #include "core/XMLNSNames.h" 44 #include "core/XMLNSNames.h"
44 #include "core/XMLNames.h" 45 #include "core/XMLNames.h"
45 #include "core/accessibility/AXObjectCache.h" 46 #include "core/accessibility/AXObjectCache.h"
46 #include "core/animation/AnimationTimeline.h" 47 #include "core/animation/AnimationTimeline.h"
(...skipping 4887 matching lines...) Expand 10 before | Expand all | Expand 10 after
4934 m_ranges.add(range); 4935 m_ranges.add(range);
4935 } 4936 }
4936 4937
4937 void Document::detachRange(Range* range) 4938 void Document::detachRange(Range* range)
4938 { 4939 {
4939 // We don't ASSERT m_ranges.contains(range) to allow us to call this 4940 // We don't ASSERT m_ranges.contains(range) to allow us to call this
4940 // unconditionally to fix: https://bugs.webkit.org/show_bug.cgi?id=26044 4941 // unconditionally to fix: https://bugs.webkit.org/show_bug.cgi?id=26044
4941 m_ranges.remove(range); 4942 m_ranges.remove(range);
4942 } 4943 }
4943 4944
4944 void Document::getCSSCanvasContext(const String& type, const String& name, int w idth, int height, RefPtrWillBeRawPtr<CanvasRenderingContext2D>& context2d, RefPt rWillBeRawPtr<WebGLRenderingContext>& context3d) 4945 void Document::getCSSCanvasContext(const String& type, const String& name, int w idth, int height, CanvasRenderingContext2DOrWebGLRenderingContext& returnValue)
4945 { 4946 {
4946 HTMLCanvasElement& element = getCSSCanvasElement(name); 4947 HTMLCanvasElement& element = getCSSCanvasElement(name);
4947 element.setSize(IntSize(width, height)); 4948 element.setSize(IntSize(width, height));
4948 CanvasRenderingContext* context = element.getContext(type); 4949 CanvasRenderingContext* context = element.getContext(type);
4949 if (!context) 4950 if (!context)
4950 return; 4951 return;
4951 4952
4952 if (context->is2d()) { 4953 if (context->is2d()) {
4953 context2d = toCanvasRenderingContext2D(context); 4954 returnValue.setCanvasRenderingContext2D(toCanvasRenderingContext2D(conte xt));
4954 } else if (context->is3d()) { 4955 } else if (context->is3d()) {
4955 context3d = toWebGLRenderingContext(context); 4956 returnValue.setWebGLRenderingContext(toWebGLRenderingContext(context));
4956 } 4957 }
4957 } 4958 }
4958 4959
4959 HTMLCanvasElement& Document::getCSSCanvasElement(const String& name) 4960 HTMLCanvasElement& Document::getCSSCanvasElement(const String& name)
4960 { 4961 {
4961 RefPtrWillBeMember<HTMLCanvasElement>& element = m_cssCanvasElements.add(nam e, nullptr).storedValue->value; 4962 RefPtrWillBeMember<HTMLCanvasElement>& element = m_cssCanvasElements.add(nam e, nullptr).storedValue->value;
4962 if (!element) { 4963 if (!element) {
4963 element = HTMLCanvasElement::create(*this); 4964 element = HTMLCanvasElement::create(*this);
4964 element->setAccelerationDisabled(true); 4965 element->setAccelerationDisabled(true);
4965 } 4966 }
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
5824 #ifndef NDEBUG 5825 #ifndef NDEBUG
5825 using namespace blink; 5826 using namespace blink;
5826 void showLiveDocumentInstances() 5827 void showLiveDocumentInstances()
5827 { 5828 {
5828 WeakDocumentSet& set = liveDocumentSet(); 5829 WeakDocumentSet& set = liveDocumentSet();
5829 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5830 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5830 for (Document* document : set) 5831 for (Document* document : set)
5831 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5832 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5832 } 5833 }
5833 #endif 5834 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698