| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. |
| 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) | 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) |
| 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 bool isValidStateTransition = (m_connectionState == ConnectionStateStarted |
| m_connectionState == ConnectionStateReceivedResponse); | 355 bool isValidStateTransition = (m_connectionState == ConnectionStateStarted |
| m_connectionState == ConnectionStateReceivedResponse); |
| 356 // In the case of multipart loads, calls to didReceiveData & didReceiveRespo
nse can be interleaved. | 356 // In the case of multipart loads, calls to didReceiveData & didReceiveRespo
nse can be interleaved. |
| 357 RELEASE_ASSERT(isMultipartPayload || isValidStateTransition); | 357 RELEASE_ASSERT(isMultipartPayload || isValidStateTransition); |
| 358 m_connectionState = ConnectionStateReceivedResponse; | 358 m_connectionState = ConnectionStateReceivedResponse; |
| 359 | 359 |
| 360 const ResourceResponse& resourceResponse = response.toResourceResponse(); | 360 const ResourceResponse& resourceResponse = response.toResourceResponse(); |
| 361 | 361 |
| 362 if (responseNeedsAccessControlCheck()) { | 362 if (responseNeedsAccessControlCheck()) { |
| 363 if (response.wasFetchedViaServiceWorker()) { | 363 if (response.wasFetchedViaServiceWorker()) { |
| 364 if (response.wasFallbackRequiredByServiceWorker()) { | 364 if (response.wasFallbackRequiredByServiceWorker()) { |
| 365 ASSERT(m_fallbackRequestForServiceWorker); |
| 365 m_loader->cancel(); | 366 m_loader->cancel(); |
| 366 m_loader.clear(); | 367 m_loader.clear(); |
| 367 m_connectionState = ConnectionStateStarted; | 368 m_connectionState = ConnectionStateStarted; |
| 368 m_request = *m_fallbackRequestForServiceWorker; | 369 m_request = *m_fallbackRequestForServiceWorker; |
| 369 m_loader = adoptPtr(blink::Platform::current()->createURLLoader(
)); | 370 m_loader = adoptPtr(blink::Platform::current()->createURLLoader(
)); |
| 370 ASSERT(m_loader); | 371 ASSERT(m_loader); |
| 371 blink::WrappedResourceRequest wrappedRequest(m_request); | 372 blink::WrappedResourceRequest wrappedRequest(m_request); |
| 372 m_loader->loadAsynchronously(wrappedRequest, this); | 373 m_loader->loadAsynchronously(wrappedRequest, this); |
| 373 return; | 374 return; |
| 374 } | 375 } |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); | 549 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); |
| 549 } | 550 } |
| 550 | 551 |
| 551 ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const | 552 ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const |
| 552 { | 553 { |
| 553 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC
redentials); | 554 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC
redentials); |
| 554 return request; | 555 return request; |
| 555 } | 556 } |
| 556 | 557 |
| 557 } | 558 } |
| OLD | NEW |