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

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

Issue 2160503002: Use Document::validBaseElementURL to init preloadscanner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 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 2891 matching lines...) Expand 10 before | Expand all | Expand 10 after
2902 const KURL& newURL = url.isEmpty() ? blankURL() : url; 2902 const KURL& newURL = url.isEmpty() ? blankURL() : url;
2903 if (newURL == m_url) 2903 if (newURL == m_url)
2904 return; 2904 return;
2905 2905
2906 m_url = newURL; 2906 m_url = newURL;
2907 m_accessEntryFromURL = nullptr; 2907 m_accessEntryFromURL = nullptr;
2908 updateBaseURL(); 2908 updateBaseURL();
2909 contextFeatures().urlDidChange(this); 2909 contextFeatures().urlDidChange(this);
2910 } 2910 }
2911 2911
2912 KURL Document::validBaseElementURL() const
2913 {
2914 if (m_baseElementURL.isValid())
2915 return m_baseElementURL;
2916
2917 return KURL();
2918 }
2919
2912 void Document::updateBaseURL() 2920 void Document::updateBaseURL()
2913 { 2921 {
2914 KURL oldBaseURL = m_baseURL; 2922 KURL oldBaseURL = m_baseURL;
2915 // DOM 3 Core: When the Document supports the feature "HTML" [DOM Level 2 HT ML], the base URI is computed using 2923 // DOM 3 Core: When the Document supports the feature "HTML" [DOM Level 2 HT ML], the base URI is computed using
2916 // first the value of the href attribute of the HTML BASE element if any, an d the value of the documentURI attribute 2924 // first the value of the href attribute of the HTML BASE element if any, an d the value of the documentURI attribute
2917 // from the Document interface otherwise (which we store, preparsed, in m_ur l). 2925 // from the Document interface otherwise (which we store, preparsed, in m_ur l).
2918 if (!m_baseElementURL.isEmpty()) 2926 if (!m_baseElementURL.isEmpty())
2919 m_baseURL = m_baseElementURL; 2927 m_baseURL = m_baseElementURL;
2920 else if (!m_baseURLOverride.isEmpty()) 2928 else if (!m_baseURLOverride.isEmpty())
2921 m_baseURL = m_baseURLOverride; 2929 m_baseURL = m_baseURLOverride;
(...skipping 3109 matching lines...) Expand 10 before | Expand all | Expand 10 after
6031 } 6039 }
6032 6040
6033 void showLiveDocumentInstances() 6041 void showLiveDocumentInstances()
6034 { 6042 {
6035 WeakDocumentSet& set = liveDocumentSet(); 6043 WeakDocumentSet& set = liveDocumentSet();
6036 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6044 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6037 for (Document* document : set) 6045 for (Document* document : set)
6038 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6046 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6039 } 6047 }
6040 #endif 6048 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698