| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 256 |
| 257 if (m_applicationCacheHost) | 257 if (m_applicationCacheHost) |
| 258 m_applicationCacheHost->failedLoadingMainResource(); | 258 m_applicationCacheHost->failedLoadingMainResource(); |
| 259 m_state = MainResourceDone; | 259 m_state = MainResourceDone; |
| 260 frameLoader()->loadFailed(this, m_mainResource->resourceError()); | 260 frameLoader()->loadFailed(this, m_mainResource->resourceError()); |
| 261 clearMainResourceHandle(); | 261 clearMainResourceHandle(); |
| 262 } | 262 } |
| 263 | 263 |
| 264 void DocumentLoader::finishedLoading(double finishTime) | 264 void DocumentLoader::finishedLoading(double finishTime) |
| 265 { | 265 { |
| 266 ASSERT(!m_frame->page()->defersLoading() || InspectorInstrumentation::isDebu
ggerPaused(m_frame)); | 266 // ASSERT(!m_frame->page()->defersLoading() || InspectorInstrumentation::isD
ebuggerPaused(m_frame)); |
| 267 | 267 |
| 268 double responseEndTime = finishTime; | 268 double responseEndTime = finishTime; |
| 269 if (!responseEndTime) | 269 if (!responseEndTime) |
| 270 responseEndTime = m_timeOfLastDataReceived; | 270 responseEndTime = m_timeOfLastDataReceived; |
| 271 if (!responseEndTime) | 271 if (!responseEndTime) |
| 272 responseEndTime = monotonicallyIncreasingTime(); | 272 responseEndTime = monotonicallyIncreasingTime(); |
| 273 timing().setResponseEnd(responseEndTime); | 273 timing().setResponseEnd(responseEndTime); |
| 274 | 274 |
| 275 commitIfReady(); | 275 commitIfReady(); |
| 276 if (!frameLoader()) | 276 if (!frameLoader()) |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 ConsoleMessage* consoleMessage = ConsoleMessage::create(Security
MessageSource, ErrorMessageLevel, message); | 396 ConsoleMessage* consoleMessage = ConsoleMessage::create(Security
MessageSource, ErrorMessageLevel, message); |
| 397 consoleMessage->setRequestIdentifier(mainResourceIdentifier()); | 397 consoleMessage->setRequestIdentifier(mainResourceIdentifier()); |
| 398 frame()->document()->addConsoleMessage(consoleMessage); | 398 frame()->document()->addConsoleMessage(consoleMessage); |
| 399 | 399 |
| 400 cancelLoadAfterXFrameOptionsOrCSPDenied(response); | 400 cancelLoadAfterXFrameOptionsOrCSPDenied(response); |
| 401 return; | 401 return; |
| 402 } | 402 } |
| 403 } | 403 } |
| 404 } | 404 } |
| 405 | 405 |
| 406 ASSERT(!m_frame->page()->defersLoading()); | 406 // ASSERT(!m_frame->page()->defersLoading()); |
| 407 | 407 |
| 408 m_response = response; | 408 m_response = response; |
| 409 | 409 |
| 410 if (isArchiveMIMEType(m_response.mimeType()) && m_mainResource->getDataBuffe
ringPolicy() != BufferData) | 410 if (isArchiveMIMEType(m_response.mimeType()) && m_mainResource->getDataBuffe
ringPolicy() != BufferData) |
| 411 m_mainResource->setDataBufferingPolicy(BufferData); | 411 m_mainResource->setDataBufferingPolicy(BufferData); |
| 412 | 412 |
| 413 if (!shouldContinueForResponse()) { | 413 if (!shouldContinueForResponse()) { |
| 414 InspectorInstrumentation::continueWithPolicyIgnore(m_frame, this, m_main
Resource->identifier(), m_response); | 414 InspectorInstrumentation::continueWithPolicyIgnore(m_frame, this, m_main
Resource->identifier(), m_response); |
| 415 m_fetcher->stopFetching(); | 415 m_fetcher->stopFetching(); |
| 416 return; | 416 return; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 | 478 |
| 479 m_writer->addData(bytes, length); | 479 m_writer->addData(bytes, length); |
| 480 } | 480 } |
| 481 | 481 |
| 482 void DocumentLoader::dataReceived(Resource* resource, const char* data, size_t l
ength) | 482 void DocumentLoader::dataReceived(Resource* resource, const char* data, size_t l
ength) |
| 483 { | 483 { |
| 484 ASSERT(data); | 484 ASSERT(data); |
| 485 ASSERT(length); | 485 ASSERT(length); |
| 486 ASSERT_UNUSED(resource, resource == m_mainResource); | 486 ASSERT_UNUSED(resource, resource == m_mainResource); |
| 487 ASSERT(!m_response.isNull()); | 487 ASSERT(!m_response.isNull()); |
| 488 ASSERT(!m_frame->page()->defersLoading()); | 488 // ASSERT(!m_frame->page()->defersLoading()); |
| 489 | 489 |
| 490 if (m_inDataReceived) { | 490 if (m_inDataReceived) { |
| 491 // If this function is reentered, defer processing of the additional | 491 // If this function is reentered, defer processing of the additional |
| 492 // data to the top-level invocation. Reentrant calls can occur because | 492 // data to the top-level invocation. Reentrant calls can occur because |
| 493 // of web platform (mis-)features that require running a nested message | 493 // of web platform (mis-)features that require running a nested message |
| 494 // loop: | 494 // loop: |
| 495 // - alert(), confirm(), prompt() | 495 // - alert(), confirm(), prompt() |
| 496 // - Detach of plugin elements. | 496 // - Detach of plugin elements. |
| 497 // - Synchronous XMLHTTPRequest | 497 // - Synchronous XMLHTTPRequest |
| 498 m_dataBuffer->append(data, length); | 498 m_dataBuffer->append(data, length); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 { | 689 { |
| 690 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding()
: emptyAtom, true, ForceSynchronousParsing); | 690 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding()
: emptyAtom, true, ForceSynchronousParsing); |
| 691 if (!source.isNull()) | 691 if (!source.isNull()) |
| 692 m_writer->appendReplacingData(source); | 692 m_writer->appendReplacingData(source); |
| 693 endWriting(m_writer.get()); | 693 endWriting(m_writer.get()); |
| 694 } | 694 } |
| 695 | 695 |
| 696 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 696 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
| 697 | 697 |
| 698 } // namespace blink | 698 } // namespace blink |
| OLD | NEW |