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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 466323002: IDL: Use Nullable for union type return value (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
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 4930 matching lines...) Expand 10 before | Expand all | Expand 10 after
4941 m_ranges.add(range); 4941 m_ranges.add(range);
4942 } 4942 }
4943 4943
4944 void Document::detachRange(Range* range) 4944 void Document::detachRange(Range* range)
4945 { 4945 {
4946 // We don't ASSERT m_ranges.contains(range) to allow us to call this 4946 // We don't ASSERT m_ranges.contains(range) to allow us to call this
4947 // unconditionally to fix: https://bugs.webkit.org/show_bug.cgi?id=26044 4947 // unconditionally to fix: https://bugs.webkit.org/show_bug.cgi?id=26044
4948 m_ranges.remove(range); 4948 m_ranges.remove(range);
4949 } 4949 }
4950 4950
4951 void Document::getCSSCanvasContext(const String& type, const String& name, int w idth, int height, bool& is2d, RefPtrWillBeRawPtr<CanvasRenderingContext2D>& cont ext2d, bool& is3d, RefPtrWillBeRawPtr<WebGLRenderingContext>& context3d) 4951 void Document::getCSSCanvasContext(const String& type, const String& name, int w idth, int height, Nullable<RefPtrWillBeRawPtr<CanvasRenderingContext2D> >& conte xt2d, Nullable<RefPtrWillBeRawPtr<WebGLRenderingContext> >& context3d)
4952 { 4952 {
4953 HTMLCanvasElement& element = getCSSCanvasElement(name); 4953 HTMLCanvasElement& element = getCSSCanvasElement(name);
4954 element.setSize(IntSize(width, height)); 4954 element.setSize(IntSize(width, height));
4955 CanvasRenderingContext* context = element.getContext(type); 4955 CanvasRenderingContext* context = element.getContext(type);
4956 if (!context) 4956 if (!context)
4957 return; 4957 return;
4958 4958
4959 if (context->is2d()) { 4959 if (context->is2d()) {
4960 is2d = true; 4960 context2d.set(toCanvasRenderingContext2D(context));
4961 context2d = toCanvasRenderingContext2D(context);
4962 } else if (context->is3d()) { 4961 } else if (context->is3d()) {
4963 is3d = true; 4962 context3d.set(toWebGLRenderingContext(context));
4964 context3d = toWebGLRenderingContext(context);
4965 } 4963 }
4966 } 4964 }
4967 4965
4968 HTMLCanvasElement& Document::getCSSCanvasElement(const String& name) 4966 HTMLCanvasElement& Document::getCSSCanvasElement(const String& name)
4969 { 4967 {
4970 RefPtrWillBeMember<HTMLCanvasElement>& element = m_cssCanvasElements.add(nam e, nullptr).storedValue->value; 4968 RefPtrWillBeMember<HTMLCanvasElement>& element = m_cssCanvasElements.add(nam e, nullptr).storedValue->value;
4971 if (!element) { 4969 if (!element) {
4972 element = HTMLCanvasElement::create(*this); 4970 element = HTMLCanvasElement::create(*this);
4973 element->setAccelerationDisabled(true); 4971 element->setAccelerationDisabled(true);
4974 } 4972 }
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
5883 using namespace blink; 5881 using namespace blink;
5884 void showLiveDocumentInstances() 5882 void showLiveDocumentInstances()
5885 { 5883 {
5886 WeakDocumentSet& set = liveDocumentSet(); 5884 WeakDocumentSet& set = liveDocumentSet();
5887 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5885 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5888 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) { 5886 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) {
5889 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data()); 5887 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data());
5890 } 5888 }
5891 } 5889 }
5892 #endif 5890 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698