| OLD | NEW |
| 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 Loading... |
| 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 { | 476 { |
| 476 ASSERT(m_state < MainResourceDone); | 477 ASSERT(m_state < MainResourceDone); |
| 477 ensureWriter(m_response.mimeType()); | 478 ensureWriter(m_response.mimeType()); |
| 478 | 479 |
| 479 // This can happen if document.close() is called by an event handler while | 480 // This can happen if document.close() is called by an event handler while |
| 480 // there's still pending incoming data. | 481 // there's still pending incoming data. |
| 481 if (m_frame && !m_frame->document()->parsing()) | 482 if (m_frame && !m_frame->document()->parsing()) |
| 482 return; | 483 return; |
| 483 | 484 |
| 484 if (length) | 485 if (length) |
| 485 m_state = DataReceived; | 486 m_dataReceived = true; |
| 486 | 487 |
| 487 m_writer->addData(bytes, length); | 488 m_writer->addData(bytes, length); |
| 488 } | 489 } |
| 489 | 490 |
| 490 void DocumentLoader::dataReceived(Resource* resource, const char* data, size_t l
ength) | 491 void DocumentLoader::dataReceived(Resource* resource, const char* data, size_t l
ength) |
| 491 { | 492 { |
| 492 ASSERT(data); | 493 ASSERT(data); |
| 493 ASSERT(length); | 494 ASSERT(length); |
| 494 ASSERT_UNUSED(resource, resource == m_mainResource); | 495 ASSERT_UNUSED(resource, resource == m_mainResource); |
| 495 ASSERT(!m_response.isNull()); | 496 ASSERT(!m_response.isNull()); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 { | 706 { |
| 706 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding()
: emptyAtom, true, ForceSynchronousParsing); | 707 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding()
: emptyAtom, true, ForceSynchronousParsing); |
| 707 if (!source.isNull()) | 708 if (!source.isNull()) |
| 708 m_writer->appendReplacingData(source); | 709 m_writer->appendReplacingData(source); |
| 709 endWriting(m_writer.get()); | 710 endWriting(m_writer.get()); |
| 710 } | 711 } |
| 711 | 712 |
| 712 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 713 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 713 | 714 |
| 714 } // namespace blink | 715 } // namespace blink |
| OLD | NEW |