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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 280 |
281 if (m_applicationCacheHost) | 281 if (m_applicationCacheHost) |
282 m_applicationCacheHost->failedLoadingMainResource(); | 282 m_applicationCacheHost->failedLoadingMainResource(); |
283 m_state = MainResourceDone; | 283 m_state = MainResourceDone; |
284 frameLoader()->loadFailed(this, m_mainResource->resourceError()); | 284 frameLoader()->loadFailed(this, m_mainResource->resourceError()); |
285 clearMainResourceHandle(); | 285 clearMainResourceHandle(); |
286 } | 286 } |
287 | 287 |
288 void DocumentLoader::finishedLoading(double finishTime) { | 288 void DocumentLoader::finishedLoading(double finishTime) { |
289 DCHECK(m_frame->loader().stateMachine()->creatingInitialEmptyDocument() || | 289 DCHECK(m_frame->loader().stateMachine()->creatingInitialEmptyDocument() || |
290 !m_frame->page()->defersLoading() || | 290 !m_frame->page()->suspended() || |
291 InspectorInstrumentation::isDebuggerPaused(m_frame)); | 291 InspectorInstrumentation::isDebuggerPaused(m_frame)); |
292 | 292 |
293 double responseEndTime = finishTime; | 293 double responseEndTime = finishTime; |
294 if (!responseEndTime) | 294 if (!responseEndTime) |
295 responseEndTime = m_timeOfLastDataReceived; | 295 responseEndTime = m_timeOfLastDataReceived; |
296 if (!responseEndTime) | 296 if (!responseEndTime) |
297 responseEndTime = monotonicallyIncreasingTime(); | 297 responseEndTime = monotonicallyIncreasingTime(); |
298 timing().setResponseEnd(responseEndTime); | 298 timing().setResponseEnd(responseEndTime); |
299 | 299 |
300 commitIfReady(); | 300 commitIfReady(); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 frameLoader()->requiredCSP() + "'."; | 474 frameLoader()->requiredCSP() + "'."; |
475 ConsoleMessage* consoleMessage = ConsoleMessage::createForRequest( | 475 ConsoleMessage* consoleMessage = ConsoleMessage::createForRequest( |
476 SecurityMessageSource, ErrorMessageLevel, message, response.url(), | 476 SecurityMessageSource, ErrorMessageLevel, message, response.url(), |
477 mainResourceIdentifier()); | 477 mainResourceIdentifier()); |
478 frame()->document()->addConsoleMessage(consoleMessage); | 478 frame()->document()->addConsoleMessage(consoleMessage); |
479 cancelLoadAfterXFrameOptionsOrCSPDenied(response); | 479 cancelLoadAfterXFrameOptionsOrCSPDenied(response); |
480 return; | 480 return; |
481 } | 481 } |
482 } | 482 } |
483 | 483 |
484 DCHECK(!m_frame->page()->defersLoading()); | 484 DCHECK(!m_frame->page()->suspended()); |
485 | 485 |
486 m_response = response; | 486 m_response = response; |
487 | 487 |
488 if (isArchiveMIMEType(m_response.mimeType()) && | 488 if (isArchiveMIMEType(m_response.mimeType()) && |
489 m_mainResource->getDataBufferingPolicy() != BufferData) | 489 m_mainResource->getDataBufferingPolicy() != BufferData) |
490 m_mainResource->setDataBufferingPolicy(BufferData); | 490 m_mainResource->setDataBufferingPolicy(BufferData); |
491 | 491 |
492 if (!shouldContinueForResponse()) { | 492 if (!shouldContinueForResponse()) { |
493 InspectorInstrumentation::continueWithPolicyIgnore( | 493 InspectorInstrumentation::continueWithPolicyIgnore( |
494 m_frame, this, m_mainResource->identifier(), m_response, | 494 m_frame, this, m_mainResource->identifier(), m_response, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 m_writer->addData(bytes, length); | 556 m_writer->addData(bytes, length); |
557 } | 557 } |
558 | 558 |
559 void DocumentLoader::dataReceived(Resource* resource, | 559 void DocumentLoader::dataReceived(Resource* resource, |
560 const char* data, | 560 const char* data, |
561 size_t length) { | 561 size_t length) { |
562 DCHECK(data); | 562 DCHECK(data); |
563 DCHECK(length); | 563 DCHECK(length); |
564 DCHECK_EQ(resource, m_mainResource); | 564 DCHECK_EQ(resource, m_mainResource); |
565 DCHECK(!m_response.isNull()); | 565 DCHECK(!m_response.isNull()); |
566 DCHECK(!m_frame->page()->defersLoading()); | 566 DCHECK(!m_frame->page()->suspended()); |
567 | 567 |
568 if (m_inDataReceived) { | 568 if (m_inDataReceived) { |
569 // If this function is reentered, defer processing of the additional data to | 569 // If this function is reentered, defer processing of the additional data to |
570 // the top-level invocation. Reentrant calls can occur because of web | 570 // the top-level invocation. Reentrant calls can occur because of web |
571 // platform (mis-)features that require running a nested message loop: | 571 // platform (mis-)features that require running a nested message loop: |
572 // - alert(), confirm(), prompt() | 572 // - alert(), confirm(), prompt() |
573 // - Detach of plugin elements. | 573 // - Detach of plugin elements. |
574 // - Synchronous XMLHTTPRequest | 574 // - Synchronous XMLHTTPRequest |
575 m_dataBuffer->append(data, length); | 575 m_dataBuffer->append(data, length); |
576 return; | 576 return; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 m_writer ? m_writer->encoding() : emptyAtom, true, | 793 m_writer ? m_writer->encoding() : emptyAtom, true, |
794 ForceSynchronousParsing); | 794 ForceSynchronousParsing); |
795 if (!source.isNull()) | 795 if (!source.isNull()) |
796 m_writer->appendReplacingData(source); | 796 m_writer->appendReplacingData(source); |
797 endWriting(); | 797 endWriting(); |
798 } | 798 } |
799 | 799 |
800 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 800 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
801 | 801 |
802 } // namespace blink | 802 } // namespace blink |
OLD | NEW |