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

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 errors 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 bool clientRedirect)
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(clientRedirect),
106 m_replacesCurrentHistoryItem(false), 107 m_replacesCurrentHistoryItem(false),
107 m_dataReceived(false), 108 m_dataReceived(false),
108 m_navigationType(NavigationTypeOther), 109 m_navigationType(NavigationTypeOther),
109 m_documentLoadTiming(*this), 110 m_documentLoadTiming(*this),
110 m_timeOfLastDataReceived(0.0), 111 m_timeOfLastDataReceived(0.0),
111 m_applicationCacheHost(ApplicationCacheHost::create(this)), 112 m_applicationCacheHost(ApplicationCacheHost::create(this)),
112 m_wasBlockedAfterXFrameOptionsOrCSP(false), 113 m_wasBlockedAfterXFrameOptionsOrCSP(false),
113 m_state(NotStarted), 114 m_state(NotStarted),
114 m_inDataReceived(false), 115 m_inDataReceived(false),
115 m_dataBuffer(SharedBuffer::create()) {} 116 m_dataBuffer(SharedBuffer::create()) {
117 // The document URL needs to be added to the head of the list as that is
118 // where the redirects originated.
119 if (m_isClientRedirect)
120 appendRedirect(m_frame->document()->url());
121 }
116 122
117 FrameLoader* DocumentLoader::frameLoader() const { 123 FrameLoader* DocumentLoader::frameLoader() const {
118 if (!m_frame) 124 if (!m_frame)
119 return nullptr; 125 return nullptr;
120 return &m_frame->loader(); 126 return &m_frame->loader();
121 } 127 }
122 128
123 DocumentLoader::~DocumentLoader() { 129 DocumentLoader::~DocumentLoader() {
124 DCHECK(!m_frame); 130 DCHECK(!m_frame);
125 DCHECK(!m_mainResource); 131 DCHECK(!m_mainResource);
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 m_writer ? m_writer->encoding() : emptyAtom, true, 793 m_writer ? m_writer->encoding() : emptyAtom, true,
788 ForceSynchronousParsing); 794 ForceSynchronousParsing);
789 if (!source.isNull()) 795 if (!source.isNull())
790 m_writer->appendReplacingData(source); 796 m_writer->appendReplacingData(source);
791 endWriting(); 797 endWriting();
792 } 798 }
793 799
794 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 800 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
795 801
796 } // namespace blink 802 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698