Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp

Issue 2816403002: test all
Patch Set: fix sharedworker Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 void ResourceLoader::Start(const ResourceRequest& request) { 77 void ResourceLoader::Start(const ResourceRequest& request) {
78 DCHECK(!loader_); 78 DCHECK(!loader_);
79 79
80 if (resource_->Options().synchronous_policy == kRequestSynchronously && 80 if (resource_->Options().synchronous_policy == kRequestSynchronously &&
81 Context().DefersLoading()) { 81 Context().DefersLoading()) {
82 Cancel(); 82 Cancel();
83 return; 83 return;
84 } 84 }
85 85
86 loader_ = WTF::WrapUnique(Platform::Current()->CreateURLLoader()); 86 loader_ = WTF::WrapUnique(Context().CreateURLLoader());
87 DCHECK(loader_); 87 DCHECK(loader_);
88 loader_->SetDefersLoading(Context().DefersLoading()); 88 loader_->SetDefersLoading(Context().DefersLoading());
89 loader_->SetLoadingTaskRunner(Context().LoadingTaskRunner().Get()); 89 loader_->SetLoadingTaskRunner(Context().LoadingTaskRunner().Get());
90 90
91 if (is_cache_aware_loading_activated_) { 91 if (is_cache_aware_loading_activated_) {
92 // Override cache policy for cache-aware loading. If this request fails, a 92 // Override cache policy for cache-aware loading. If this request fails, a
93 // reload with original request will be triggered in didFail(). 93 // reload with original request will be triggered in didFail().
94 ResourceRequest cache_aware_request(request); 94 ResourceRequest cache_aware_request(request);
95 cache_aware_request.SetCachePolicy(WebCachePolicy::kReturnCacheDataIfValid); 95 cache_aware_request.SetCachePolicy(WebCachePolicy::kReturnCacheDataIfValid);
96 loader_->LoadAsynchronously(WrappedResourceRequest(cache_aware_request), 96 loader_->LoadAsynchronously(WrappedResourceRequest(cache_aware_request),
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 return; 522 return;
523 523
524 // Don't activate if cache policy is explicitly set. 524 // Don't activate if cache policy is explicitly set.
525 if (request.GetCachePolicy() != WebCachePolicy::kUseProtocolCachePolicy) 525 if (request.GetCachePolicy() != WebCachePolicy::kUseProtocolCachePolicy)
526 return; 526 return;
527 527
528 is_cache_aware_loading_activated_ = true; 528 is_cache_aware_loading_activated_ = true;
529 } 529 }
530 530
531 } // namespace blink 531 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698