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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 void ResourceLoader::start(const ResourceRequest& request, | 74 void ResourceLoader::start(const ResourceRequest& request, |
75 WebTaskRunner* loadingTaskRunner, | 75 WebTaskRunner* loadingTaskRunner, |
76 bool defersLoading) { | 76 bool defersLoading) { |
77 DCHECK(!m_loader); | 77 DCHECK(!m_loader); |
78 if (m_resource->options().synchronousPolicy == RequestSynchronously && | 78 if (m_resource->options().synchronousPolicy == RequestSynchronously && |
79 defersLoading) { | 79 defersLoading) { |
80 cancel(); | 80 cancel(); |
81 return; | 81 return; |
82 } | 82 } |
83 | 83 |
84 m_loader = wrapUnique(Platform::current()->createURLLoader()); | 84 m_loader = WTF::wrapUnique(Platform::current()->createURLLoader()); |
85 DCHECK(m_loader); | 85 DCHECK(m_loader); |
86 m_loader->setDefersLoading(defersLoading); | 86 m_loader->setDefersLoading(defersLoading); |
87 m_loader->setLoadingTaskRunner(loadingTaskRunner); | 87 m_loader->setLoadingTaskRunner(loadingTaskRunner); |
88 | 88 |
89 if (m_isCacheAwareLoadingActivated) { | 89 if (m_isCacheAwareLoadingActivated) { |
90 // Override cache policy for cache-aware loading. If this request fails, a | 90 // Override cache policy for cache-aware loading. If this request fails, a |
91 // reload with original request will be triggered in didFail(). | 91 // reload with original request will be triggered in didFail(). |
92 ResourceRequest cacheAwareRequest(request); | 92 ResourceRequest cacheAwareRequest(request); |
93 cacheAwareRequest.setCachePolicy(WebCachePolicy::ReturnCacheDataIfValid); | 93 cacheAwareRequest.setCachePolicy(WebCachePolicy::ReturnCacheDataIfValid); |
94 m_loader->loadAsynchronously(WrappedResourceRequest(cacheAwareRequest), | 94 m_loader->loadAsynchronously(WrappedResourceRequest(cacheAwareRequest), |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 return; | 319 return; |
320 | 320 |
321 // Don't activate if cache policy is explicitly set. | 321 // Don't activate if cache policy is explicitly set. |
322 if (request.getCachePolicy() != WebCachePolicy::UseProtocolCachePolicy) | 322 if (request.getCachePolicy() != WebCachePolicy::UseProtocolCachePolicy) |
323 return; | 323 return; |
324 | 324 |
325 m_isCacheAwareLoadingActivated = true; | 325 m_isCacheAwareLoadingActivated = true; |
326 } | 326 } |
327 | 327 |
328 } // namespace blink | 328 } // namespace blink |
OLD | NEW |