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

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

Issue 1364863002: DocumentLoader::isCommittedButEmpty is timing-dependent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Emulate onPageFinished Created 4 years, 4 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 98 }
99 99
100 DocumentLoader::DocumentLoader(LocalFrame* frame, const ResourceRequest& req, co nst SubstituteData& substituteData) 100 DocumentLoader::DocumentLoader(LocalFrame* frame, const ResourceRequest& req, co nst SubstituteData& substituteData)
101 : m_frame(frame) 101 : m_frame(frame)
102 , m_fetcher(FrameFetchContext::createContextAndFetcher(this, nullptr)) 102 , m_fetcher(FrameFetchContext::createContextAndFetcher(this, nullptr))
103 , m_originalRequest(req) 103 , m_originalRequest(req)
104 , m_substituteData(substituteData) 104 , m_substituteData(substituteData)
105 , m_request(req) 105 , m_request(req)
106 , m_isClientRedirect(false) 106 , m_isClientRedirect(false)
107 , m_replacesCurrentHistoryItem(false) 107 , m_replacesCurrentHistoryItem(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())
116 { 117 {
117 } 118 }
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 { 481 {
481 ASSERT(m_state < MainResourceDone); 482 ASSERT(m_state < MainResourceDone);
482 ensureWriter(m_response.mimeType()); 483 ensureWriter(m_response.mimeType());
483 484
484 // This can happen if document.close() is called by an event handler while 485 // This can happen if document.close() is called by an event handler while
485 // there's still pending incoming data. 486 // there's still pending incoming data.
486 if (m_frame && !m_frame->document()->parsing()) 487 if (m_frame && !m_frame->document()->parsing())
487 return; 488 return;
488 489
489 if (length) 490 if (length)
490 m_state = DataReceived; 491 m_dataReceived = true;
491 492
492 m_writer->addData(bytes, length); 493 m_writer->addData(bytes, length);
493 } 494 }
494 495
495 void DocumentLoader::dataReceived(Resource* resource, const char* data, size_t l ength) 496 void DocumentLoader::dataReceived(Resource* resource, const char* data, size_t l ength)
496 { 497 {
497 ASSERT(data); 498 ASSERT(data);
498 ASSERT(length); 499 ASSERT(length);
499 ASSERT_UNUSED(resource, resource == m_mainResource); 500 ASSERT_UNUSED(resource, resource == m_mainResource);
500 ASSERT(!m_response.isNull()); 501 ASSERT(!m_response.isNull());
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 { 711 {
711 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true, ForceSynchronousParsing); 712 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true, ForceSynchronousParsing);
712 if (!source.isNull()) 713 if (!source.isNull())
713 m_writer->appendReplacingData(source); 714 m_writer->appendReplacingData(source);
714 endWriting(m_writer.get()); 715 endWriting(m_writer.get());
715 } 716 }
716 717
717 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 718 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
718 719
719 } // namespace blink 720 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.h ('k') | third_party/WebKit/Source/web/tests/DocumentLoaderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698