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

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

Issue 138643003: Simpler return value of HashTable::add/HashMap:add and others (Closed)
Patch Set: Daily master update (now with base url?) Created 6 years, 10 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 4725 matching lines...) Expand 10 before | Expand all | Expand 10 after
4736 { 4736 {
4737 HTMLCanvasElement* element = getCSSCanvasElement(name); 4737 HTMLCanvasElement* element = getCSSCanvasElement(name);
4738 if (!element) 4738 if (!element)
4739 return 0; 4739 return 0;
4740 element->setSize(IntSize(width, height)); 4740 element->setSize(IntSize(width, height));
4741 return element->getContext(type); 4741 return element->getContext(type);
4742 } 4742 }
4743 4743
4744 HTMLCanvasElement* Document::getCSSCanvasElement(const String& name) 4744 HTMLCanvasElement* Document::getCSSCanvasElement(const String& name)
4745 { 4745 {
4746 RefPtr<HTMLCanvasElement>& element = m_cssCanvasElements.add(name, 0).iterat or->value; 4746 RefPtr<HTMLCanvasElement>& element = m_cssCanvasElements.add(name, 0).stored Value->value;
4747 if (!element) { 4747 if (!element) {
4748 element = HTMLCanvasElement::create(*this); 4748 element = HTMLCanvasElement::create(*this);
4749 element->setAccelerationDisabled(true); 4749 element->setAccelerationDisabled(true);
4750 } 4750 }
4751 return element.get(); 4751 return element.get();
4752 } 4752 }
4753 4753
4754 void Document::initDNSPrefetch() 4754 void Document::initDNSPrefetch()
4755 { 4755 {
4756 Settings* settings = this->settings(); 4756 Settings* settings = this->settings();
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
5319 return m_styleEngine->haveStylesheetsLoaded(); 5319 return m_styleEngine->haveStylesheetsLoaded();
5320 } 5320 }
5321 5321
5322 Locale& Document::getCachedLocale(const AtomicString& locale) 5322 Locale& Document::getCachedLocale(const AtomicString& locale)
5323 { 5323 {
5324 AtomicString localeKey = locale; 5324 AtomicString localeKey = locale;
5325 if (locale.isEmpty() || !RuntimeEnabledFeatures::langAttributeAwareFormContr olUIEnabled()) 5325 if (locale.isEmpty() || !RuntimeEnabledFeatures::langAttributeAwareFormContr olUIEnabled())
5326 return Locale::defaultLocale(); 5326 return Locale::defaultLocale();
5327 LocaleIdentifierToLocaleMap::AddResult result = m_localeCache.add(localeKey, nullptr); 5327 LocaleIdentifierToLocaleMap::AddResult result = m_localeCache.add(localeKey, nullptr);
5328 if (result.isNewEntry) 5328 if (result.isNewEntry)
5329 result.iterator->value = Locale::create(localeKey); 5329 result.storedValue->value = Locale::create(localeKey);
5330 return *(result.iterator->value); 5330 return *(result.storedValue->value);
5331 } 5331 }
5332 5332
5333 Document& Document::ensureTemplateDocument() 5333 Document& Document::ensureTemplateDocument()
5334 { 5334 {
5335 if (isTemplateDocument()) 5335 if (isTemplateDocument())
5336 return *this; 5336 return *this;
5337 5337
5338 if (m_templateDocument) 5338 if (m_templateDocument)
5339 return *m_templateDocument; 5339 return *m_templateDocument;
5340 5340
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
5461 void Document::defaultEventHandler(Event* event) 5461 void Document::defaultEventHandler(Event* event)
5462 { 5462 {
5463 if (frame() && frame()->remotePlatformLayer()) { 5463 if (frame() && frame()->remotePlatformLayer()) {
5464 frame()->chromeClient().forwardInputEvent(this, event); 5464 frame()->chromeClient().forwardInputEvent(this, event);
5465 return; 5465 return;
5466 } 5466 }
5467 Node::defaultEventHandler(event); 5467 Node::defaultEventHandler(event);
5468 } 5468 }
5469 5469
5470 } // namespace WebCore 5470 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/ChildListMutationScope.cpp ('k') | Source/core/dom/DocumentMarkerController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698