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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Issue 2461043003: Fix for the RedirectTest.ClientServerServer test. (Closed)
Patch Set: More build error fixes Created 4 years, 1 month 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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // effective script origin of the Document are those it was assigned when its 89 // effective script origin of the Document are those it was assigned when its
90 // browsing context was created. 90 // browsing context was created.
91 // 91 //
92 // Note: We generalize this to all "blank" URLs and invalid URLs because we 92 // Note: We generalize this to all "blank" URLs and invalid URLs because we
93 // treat all of these URLs as about:blank. 93 // treat all of these URLs as about:blank.
94 return url.isEmpty() || url.protocolIsAbout(); 94 return url.isEmpty() || url.protocolIsAbout();
95 } 95 }
96 96
97 DocumentLoader::DocumentLoader(LocalFrame* frame, 97 DocumentLoader::DocumentLoader(LocalFrame* frame,
98 const ResourceRequest& req, 98 const ResourceRequest& req,
99 const SubstituteData& substituteData) 99 const SubstituteData& substituteData,
100 ClientRedirectPolicy clientRedirectPolicy)
100 : m_frame(frame), 101 : m_frame(frame),
101 m_fetcher(FrameFetchContext::createContextAndFetcher(this, nullptr)), 102 m_fetcher(FrameFetchContext::createContextAndFetcher(this, nullptr)),
102 m_originalRequest(req), 103 m_originalRequest(req),
103 m_substituteData(substituteData), 104 m_substituteData(substituteData),
104 m_request(req), 105 m_request(req),
105 m_isClientRedirect(false), 106 m_isClientRedirect(clientRedirectPolicy ==
107 ClientRedirectPolicy::ClientRedirect),
106 m_replacesCurrentHistoryItem(false), 108 m_replacesCurrentHistoryItem(false),
107 m_dataReceived(false), 109 m_dataReceived(false),
108 m_navigationType(NavigationTypeOther), 110 m_navigationType(NavigationTypeOther),
109 m_documentLoadTiming(*this), 111 m_documentLoadTiming(*this),
110 m_timeOfLastDataReceived(0.0), 112 m_timeOfLastDataReceived(0.0),
111 m_applicationCacheHost(ApplicationCacheHost::create(this)), 113 m_applicationCacheHost(ApplicationCacheHost::create(this)),
112 m_wasBlockedAfterXFrameOptionsOrCSP(false), 114 m_wasBlockedAfterXFrameOptionsOrCSP(false),
113 m_state(NotStarted), 115 m_state(NotStarted),
114 m_inDataReceived(false), 116 m_inDataReceived(false),
115 m_dataBuffer(SharedBuffer::create()) {} 117 m_dataBuffer(SharedBuffer::create()) {
118 // The document URL needs to be added to the head of the list as that is
119 // where the redirects originated.
120 if (m_isClientRedirect)
121 appendRedirect(m_frame->document()->url());
122 }
116 123
117 FrameLoader* DocumentLoader::frameLoader() const { 124 FrameLoader* DocumentLoader::frameLoader() const {
118 if (!m_frame) 125 if (!m_frame)
119 return nullptr; 126 return nullptr;
120 return &m_frame->loader(); 127 return &m_frame->loader();
121 } 128 }
122 129
123 DocumentLoader::~DocumentLoader() { 130 DocumentLoader::~DocumentLoader() {
124 DCHECK(!m_frame); 131 DCHECK(!m_frame);
125 DCHECK(!m_mainResource); 132 DCHECK(!m_mainResource);
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 m_writer ? m_writer->encoding() : emptyAtom, true, 794 m_writer ? m_writer->encoding() : emptyAtom, true,
788 ForceSynchronousParsing); 795 ForceSynchronousParsing);
789 if (!source.isNull()) 796 if (!source.isNull())
790 m_writer->appendReplacingData(source); 797 m_writer->appendReplacingData(source);
791 endWriting(); 798 endWriting();
792 } 799 }
793 800
794 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 801 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
795 802
796 } // namespace blink 803 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.h ('k') | third_party/WebKit/Source/core/loader/EmptyClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698