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

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

Issue 1381003004: Better distinguish didFinishLoad and didStopLoading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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) 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 286
287 if (!maybeCreateArchive()) { 287 if (!maybeCreateArchive()) {
288 // If this is an empty document, it will not have actually been created yet. Commit dummy data so that 288 // If this is an empty document, it will not have actually been created yet. Commit dummy data so that
289 // DocumentWriter::begin() gets called and creates the Document. 289 // DocumentWriter::begin() gets called and creates the Document.
290 if (!m_writer) 290 if (!m_writer)
291 commitData(0, 0); 291 commitData(0, 0);
292 } 292 }
293 293
294 endWriting(m_writer.get()); 294 endWriting(m_writer.get());
295 295
296 if (!m_mainDocumentError.isNull()) 296 if (!m_mainDocumentError.isNull() || !m_frame)
dcheng 2015/10/08 05:34:35 How can m_frame be null now?
Nate Chapin 2015/10/08 21:03:59 It could be null when the DocumentLoader is synchr
297 return; 297 return;
298 m_state = MainResourceDone; 298 if (m_state < MainResourceDone)
299 299 m_state = MainResourceDone;
300 // If the document specified an application cache manifest, it violates the author's intent if we store it in the memory cache
301 // and deny the appcache the chance to intercept it in the future, so remove from the memory cache.
302 if (m_frame) {
303 if (m_mainResource && m_frame->document()->hasAppCacheManifest())
Nate Chapin 2015/10/06 18:35:36 This code should have been removed when we blinked
304 memoryCache()->remove(m_mainResource.get());
305 }
306 m_applicationCacheHost->finishedLoadingMainResource(); 300 m_applicationCacheHost->finishedLoadingMainResource();
307 clearMainResourceHandle(); 301 clearMainResourceHandle();
308 } 302 }
309 303
310 bool DocumentLoader::isRedirectAfterPost(const ResourceRequest& newRequest, cons t ResourceResponse& redirectResponse) 304 bool DocumentLoader::isRedirectAfterPost(const ResourceRequest& newRequest, cons t ResourceResponse& redirectResponse)
311 { 305 {
312 int status = redirectResponse.httpStatusCode(); 306 int status = redirectResponse.httpStatusCode();
313 if (((status >= 301 && status <= 303) || status == 307) 307 if (((status >= 301 && status <= 303) || status == 307)
314 && m_originalRequest.httpMethod() == "POST") 308 && m_originalRequest.httpMethod() == "POST")
315 return true; 309 return true;
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 { 869 {
876 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing); 870 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing);
877 if (!source.isNull()) 871 if (!source.isNull())
878 m_writer->appendReplacingData(source); 872 m_writer->appendReplacingData(source);
879 endWriting(m_writer.get()); 873 endWriting(m_writer.get());
880 } 874 }
881 875
882 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 876 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
883 877
884 } // namespace blink 878 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698