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

Unified Diff: Source/WebCore/dom/Document.cpp

Issue 7147018: Merge 87756 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/dom/Document.h ('k') | Source/WebCore/html/MediaDocument.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/Document.cpp
===================================================================
--- Source/WebCore/dom/Document.cpp (revision 88811)
+++ Source/WebCore/dom/Document.cpp (working copy)
@@ -443,7 +443,6 @@
m_ignoreAutofocus = false;
m_frame = frame;
- m_documentLoader = frame ? frame->loader()->activeDocumentLoader() : 0;
// We depend on the url getting immediately set in subframes, but we
// also depend on the url NOT getting immediately set in opened windows.
@@ -3733,7 +3732,9 @@
DateComponents date;
bool foundDate = false;
if (m_frame) {
- String httpLastModified = m_documentLoader->response().httpHeaderField("Last-Modified");
+ String httpLastModified;
+ if (DocumentLoader* documentLoader = loader())
+ httpLastModified = documentLoader->response().httpHeaderField("Last-Modified");
if (!httpLastModified.isEmpty()) {
date.setMillisecondsSinceEpochForDateTime(parseDate(httpLastModified));
foundDate = true;
@@ -4441,7 +4442,9 @@
// load local resources. See https://bugs.webkit.org/show_bug.cgi?id=16756
// and https://bugs.webkit.org/show_bug.cgi?id=19760 for further
// discussion.
- if (m_documentLoader->substituteData().isValid())
+
+ DocumentLoader* documentLoader = loader();
+ if (documentLoader && documentLoader->substituteData().isValid())
securityOrigin()->grantLoadLocalResources();
}
@@ -4522,7 +4525,9 @@
setURL(url);
f->loader()->setOutgoingReferrer(url);
- m_documentLoader->replaceRequestURLForSameDocumentNavigation(url);
+
+ if (DocumentLoader* documentLoader = loader())
+ documentLoader->replaceRequestURLForSameDocumentNavigation(url);
}
void Document::statePopped(SerializedScriptValue* stateObject)
@@ -4988,4 +4993,19 @@
}
#endif
+DocumentLoader* Document::loader() const
+{
+ if (!m_frame)
+ return 0;
+
+ DocumentLoader* loader = m_frame->loader()->activeDocumentLoader();
+ if (!loader)
+ return 0;
+
+ if (m_frame->document() != this)
+ return 0;
+
+ return loader;
+}
+
} // namespace WebCore
« no previous file with comments | « Source/WebCore/dom/Document.h ('k') | Source/WebCore/html/MediaDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698