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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 if (m_resource->options().synchronousPolicy == RequestSynchronously && | 82 if (m_resource->options().synchronousPolicy == RequestSynchronously && |
83 context().defersLoading()) { | 83 context().defersLoading()) { |
84 cancel(); | 84 cancel(); |
85 return; | 85 return; |
86 } | 86 } |
87 | 87 |
88 m_loader = WTF::wrapUnique(Platform::current()->createURLLoader()); | 88 m_loader = WTF::wrapUnique(Platform::current()->createURLLoader()); |
89 DCHECK(m_loader); | 89 DCHECK(m_loader); |
90 m_loader->setDefersLoading(context().defersLoading()); | 90 m_loader->setDefersLoading(context().defersLoading()); |
91 m_loader->setLoadingTaskRunner(context().loadingTaskRunner()); | 91 m_loader->setLoadingTaskRunner(context().loadingTaskRunner().get()); |
92 | 92 |
93 if (m_isCacheAwareLoadingActivated) { | 93 if (m_isCacheAwareLoadingActivated) { |
94 // Override cache policy for cache-aware loading. If this request fails, a | 94 // Override cache policy for cache-aware loading. If this request fails, a |
95 // reload with original request will be triggered in didFail(). | 95 // reload with original request will be triggered in didFail(). |
96 ResourceRequest cacheAwareRequest(request); | 96 ResourceRequest cacheAwareRequest(request); |
97 cacheAwareRequest.setCachePolicy(WebCachePolicy::ReturnCacheDataIfValid); | 97 cacheAwareRequest.setCachePolicy(WebCachePolicy::ReturnCacheDataIfValid); |
98 m_loader->loadAsynchronously(WrappedResourceRequest(cacheAwareRequest), | 98 m_loader->loadAsynchronously(WrappedResourceRequest(cacheAwareRequest), |
99 this); | 99 this); |
100 return; | 100 return; |
101 } | 101 } |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 return; | 510 return; |
511 | 511 |
512 // Don't activate if cache policy is explicitly set. | 512 // Don't activate if cache policy is explicitly set. |
513 if (request.getCachePolicy() != WebCachePolicy::UseProtocolCachePolicy) | 513 if (request.getCachePolicy() != WebCachePolicy::UseProtocolCachePolicy) |
514 return; | 514 return; |
515 | 515 |
516 m_isCacheAwareLoadingActivated = true; | 516 m_isCacheAwareLoadingActivated = true; |
517 } | 517 } |
518 | 518 |
519 } // namespace blink | 519 } // namespace blink |
OLD | NEW |