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

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

Issue 181703004: Have Document::timing() / Document::contextFeatures() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/timing/PerformanceTiming.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2692 matching lines...) Expand 10 before | Expand all | Expand 10 after
2703 } 2703 }
2704 2704
2705 void Document::setURL(const KURL& url) 2705 void Document::setURL(const KURL& url)
2706 { 2706 {
2707 const KURL& newURL = url.isEmpty() ? blankURL() : url; 2707 const KURL& newURL = url.isEmpty() ? blankURL() : url;
2708 if (newURL == m_url) 2708 if (newURL == m_url)
2709 return; 2709 return;
2710 2710
2711 m_url = newURL; 2711 m_url = newURL;
2712 updateBaseURL(); 2712 updateBaseURL();
2713 contextFeatures()->urlDidChange(this); 2713 contextFeatures().urlDidChange(this);
2714 } 2714 }
2715 2715
2716 void Document::updateBaseURL() 2716 void Document::updateBaseURL()
2717 { 2717 {
2718 KURL oldBaseURL = m_baseURL; 2718 KURL oldBaseURL = m_baseURL;
2719 // DOM 3 Core: When the Document supports the feature "HTML" [DOM Level 2 HT ML], the base URI is computed using 2719 // DOM 3 Core: When the Document supports the feature "HTML" [DOM Level 2 HT ML], the base URI is computed using
2720 // first the value of the href attribute of the HTML BASE element if any, an d the value of the documentURI attribute 2720 // first the value of the href attribute of the HTML BASE element if any, an d the value of the documentURI attribute
2721 // from the Document interface otherwise (which we store, preparsed, in m_ur l). 2721 // from the Document interface otherwise (which we store, preparsed, in m_ur l).
2722 if (!m_baseElementURL.isEmpty()) 2722 if (!m_baseElementURL.isEmpty())
2723 m_baseURL = m_baseElementURL; 2723 m_baseURL = m_baseElementURL;
(...skipping 2396 matching lines...) Expand 10 before | Expand all | Expand 10 after
5120 --m_activeParserCount; 5120 --m_activeParserCount;
5121 if (!frame()) 5121 if (!frame())
5122 return; 5122 return;
5123 // FIXME: This should always be enabled, but it seems to cause 5123 // FIXME: This should always be enabled, but it seems to cause
5124 // http/tests/security/feed-urls-from-remote.html to timeout on Mac WK1 5124 // http/tests/security/feed-urls-from-remote.html to timeout on Mac WK1
5125 // see http://webkit.org/b/110554 and http://webkit.org/b/110401 5125 // see http://webkit.org/b/110554 and http://webkit.org/b/110401
5126 loader()->checkLoadComplete(); 5126 loader()->checkLoadComplete();
5127 frame()->loader().checkLoadComplete(); 5127 frame()->loader().checkLoadComplete();
5128 } 5128 }
5129 5129
5130 void Document::setContextFeatures(PassRefPtr<ContextFeatures> features) 5130 void Document::setContextFeatures(ContextFeatures& features)
5131 { 5131 {
5132 m_contextFeatures = features; 5132 m_contextFeatures = PassRefPtr<ContextFeatures>(features);
5133 } 5133 }
5134 5134
5135 static RenderObject* nearestCommonHoverAncestor(RenderObject* obj1, RenderObject * obj2) 5135 static RenderObject* nearestCommonHoverAncestor(RenderObject* obj1, RenderObject * obj2)
5136 { 5136 {
5137 if (!obj1 || !obj2) 5137 if (!obj1 || !obj2)
5138 return 0; 5138 return 0;
5139 5139
5140 for (RenderObject* currObj1 = obj1; currObj1; currObj1 = currObj1->hoverAnce stor()) { 5140 for (RenderObject* currObj1 = obj1; currObj1; currObj1 = currObj1->hoverAnce stor()) {
5141 for (RenderObject* currObj2 = obj2; currObj2; currObj2 = currObj2->hover Ancestor()) { 5141 for (RenderObject* currObj2 = obj2; currObj2; currObj2 = currObj2->hover Ancestor()) {
5142 if (currObj1 == currObj2) 5142 if (currObj1 == currObj2)
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
5438 void Document::defaultEventHandler(Event* event) 5438 void Document::defaultEventHandler(Event* event)
5439 { 5439 {
5440 if (frame() && frame()->remotePlatformLayer()) { 5440 if (frame() && frame()->remotePlatformLayer()) {
5441 frame()->chromeClient().forwardInputEvent(this, event); 5441 frame()->chromeClient().forwardInputEvent(this, event);
5442 return; 5442 return;
5443 } 5443 }
5444 Node::defaultEventHandler(event); 5444 Node::defaultEventHandler(event);
5445 } 5445 }
5446 5446
5447 } // namespace WebCore 5447 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/timing/PerformanceTiming.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698