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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 stopLoadingSubresources(); | 291 stopLoadingSubresources(); |
292 | 292 |
293 m_isStopping = false; | 293 m_isStopping = false; |
294 } | 294 } |
295 | 295 |
296 void DocumentLoader::commitIfReady() | 296 void DocumentLoader::commitIfReady() |
297 { | 297 { |
298 if (!m_committed) { | 298 if (!m_committed) { |
299 m_committed = true; | 299 m_committed = true; |
300 frameLoader()->commitProvisionalLoad(); | 300 frameLoader()->commitProvisionalLoad(); |
| 301 m_writer.setMIMEType(m_response.mimeType()); |
301 } | 302 } |
302 } | 303 } |
303 | 304 |
304 bool DocumentLoader::isLoading() const | 305 bool DocumentLoader::isLoading() const |
305 { | 306 { |
306 if (document() && document()->hasActiveParser()) | 307 if (document() && document()->hasActiveParser()) |
307 return true; | 308 return true; |
308 | 309 |
309 return isLoadingMainResource() || !m_resourceLoaders.isEmpty(); | 310 return isLoadingMainResource() || !m_resourceLoaders.isEmpty(); |
310 } | 311 } |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 if (SecurityPolicy::allowSubstituteDataAccessToLocal() && m_originalSubs
tituteDataWasValid) { | 675 if (SecurityPolicy::allowSubstituteDataAccessToLocal() && m_originalSubs
tituteDataWasValid) { |
675 // If this document was loaded with substituteData, then the documen
t can | 676 // If this document was loaded with substituteData, then the documen
t can |
676 // load local resources. See https://bugs.webkit.org/show_bug.cgi?id
=16756 | 677 // load local resources. See https://bugs.webkit.org/show_bug.cgi?id
=16756 |
677 // and https://bugs.webkit.org/show_bug.cgi?id=19760 for further | 678 // and https://bugs.webkit.org/show_bug.cgi?id=19760 for further |
678 // discussion. | 679 // discussion. |
679 m_frame->document()->securityOrigin()->grantLoadLocalResources(); | 680 m_frame->document()->securityOrigin()->grantLoadLocalResources(); |
680 } | 681 } |
681 | 682 |
682 if (frameLoader()->stateMachine()->creatingInitialEmptyDocument()) | 683 if (frameLoader()->stateMachine()->creatingInitialEmptyDocument()) |
683 return; | 684 return; |
| 685 if (frameLoader()->stateMachine()->isDisplayingInitialEmptyDocument()) |
| 686 frameLoader()->stateMachine()->advanceTo(FrameLoaderStateMachine::Co
mmittedFirstRealLoad); |
684 | 687 |
685 // The origin is the MHTML file, we need to set the base URL to the docu
ment encoded in the MHTML so | 688 // The origin is the MHTML file, we need to set the base URL to the docu
ment encoded in the MHTML so |
686 // relative URLs are resolved properly. | 689 // relative URLs are resolved properly. |
687 if (m_archive) | 690 if (m_archive) |
688 m_frame->document()->setBaseURLOverride(m_archive->mainResource()->u
rl()); | 691 m_frame->document()->setBaseURLOverride(m_archive->mainResource()->u
rl()); |
689 | 692 |
690 // Call receivedFirstData() exactly once per load. We should only reach
this point multiple times | 693 // Call receivedFirstData() exactly once per load. We should only reach
this point multiple times |
691 // for multipart loads, and FrameLoader::isReplacing() will be true afte
r the first time. | 694 // for multipart loads, and FrameLoader::isReplacing() will be true afte
r the first time. |
692 if (!isMultipartReplacingLoad()) | 695 if (!isMultipartReplacingLoad()) |
693 frameLoader()->receivedFirstData(); | 696 frameLoader()->receivedFirstData(); |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 commitLoad(resourceData->data(), resourceData->size()); | 1168 commitLoad(resourceData->data(), resourceData->size()); |
1166 } | 1169 } |
1167 | 1170 |
1168 void DocumentLoader::handledOnloadEvents() | 1171 void DocumentLoader::handledOnloadEvents() |
1169 { | 1172 { |
1170 m_wasOnloadHandled = true; | 1173 m_wasOnloadHandled = true; |
1171 applicationCacheHost()->stopDeferringEvents(); | 1174 applicationCacheHost()->stopDeferringEvents(); |
1172 } | 1175 } |
1173 | 1176 |
1174 } // namespace WebCore | 1177 } // namespace WebCore |
OLD | NEW |