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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 stopLoadingSubresources(); | 285 stopLoadingSubresources(); |
286 | 286 |
287 m_isStopping = false; | 287 m_isStopping = false; |
288 } | 288 } |
289 | 289 |
290 void DocumentLoader::commitIfReady() | 290 void DocumentLoader::commitIfReady() |
291 { | 291 { |
292 if (!m_committed) { | 292 if (!m_committed) { |
293 m_committed = true; | 293 m_committed = true; |
294 frameLoader()->commitProvisionalLoad(); | 294 frameLoader()->commitProvisionalLoad(); |
| 295 m_writer.setMIMEType(m_response.mimeType()); |
295 } | 296 } |
296 } | 297 } |
297 | 298 |
298 bool DocumentLoader::isLoading() const | 299 bool DocumentLoader::isLoading() const |
299 { | 300 { |
300 if (document() && document()->hasActiveParser()) | 301 if (document() && document()->hasActiveParser()) |
301 return true; | 302 return true; |
302 | 303 |
303 return isLoadingMainResource() || !m_resourceLoaders.isEmpty(); | 304 return isLoadingMainResource() || !m_resourceLoaders.isEmpty(); |
304 } | 305 } |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 if (SecurityPolicy::allowSubstituteDataAccessToLocal() && m_originalSubs
tituteDataWasValid) { | 640 if (SecurityPolicy::allowSubstituteDataAccessToLocal() && m_originalSubs
tituteDataWasValid) { |
640 // If this document was loaded with substituteData, then the documen
t can | 641 // If this document was loaded with substituteData, then the documen
t can |
641 // load local resources. See https://bugs.webkit.org/show_bug.cgi?id
=16756 | 642 // load local resources. See https://bugs.webkit.org/show_bug.cgi?id
=16756 |
642 // and https://bugs.webkit.org/show_bug.cgi?id=19760 for further | 643 // and https://bugs.webkit.org/show_bug.cgi?id=19760 for further |
643 // discussion. | 644 // discussion. |
644 m_frame->document()->securityOrigin()->grantLoadLocalResources(); | 645 m_frame->document()->securityOrigin()->grantLoadLocalResources(); |
645 } | 646 } |
646 | 647 |
647 if (frameLoader()->stateMachine()->creatingInitialEmptyDocument()) | 648 if (frameLoader()->stateMachine()->creatingInitialEmptyDocument()) |
648 return; | 649 return; |
| 650 if (frameLoader()->stateMachine()->isDisplayingInitialEmptyDocument()) |
| 651 frameLoader()->stateMachine()->advanceTo(FrameLoaderStateMachine::Co
mmittedFirstRealLoad); |
649 | 652 |
650 // The origin is the MHTML file, we need to set the base URL to the docu
ment encoded in the MHTML so | 653 // The origin is the MHTML file, we need to set the base URL to the docu
ment encoded in the MHTML so |
651 // relative URLs are resolved properly. | 654 // relative URLs are resolved properly. |
652 if (m_archive) | 655 if (m_archive) |
653 m_frame->document()->setBaseURLOverride(m_archive->mainResource()->u
rl()); | 656 m_frame->document()->setBaseURLOverride(m_archive->mainResource()->u
rl()); |
654 | 657 |
655 // Call receivedFirstData() exactly once per load. We should only reach
this point multiple times | 658 // Call receivedFirstData() exactly once per load. We should only reach
this point multiple times |
656 // for multipart loads, and FrameLoader::isReplacing() will be true afte
r the first time. | 659 // for multipart loads, and FrameLoader::isReplacing() will be true afte
r the first time. |
657 if (!isMultipartReplacingLoad()) | 660 if (!isMultipartReplacingLoad()) |
658 frameLoader()->receivedFirstData(); | 661 frameLoader()->receivedFirstData(); |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 commitLoad(resourceData->data(), resourceData->size()); | 1133 commitLoad(resourceData->data(), resourceData->size()); |
1131 } | 1134 } |
1132 | 1135 |
1133 void DocumentLoader::handledOnloadEvents() | 1136 void DocumentLoader::handledOnloadEvents() |
1134 { | 1137 { |
1135 m_wasOnloadHandled = true; | 1138 m_wasOnloadHandled = true; |
1136 applicationCacheHost()->stopDeferringEvents(); | 1139 applicationCacheHost()->stopDeferringEvents(); |
1137 } | 1140 } |
1138 | 1141 |
1139 } // namespace WebCore | 1142 } // namespace WebCore |
OLD | NEW |