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

Side by Side Diff: ios/net/crn_http_protocol_handler.mm

Issue 2398613002: [HttpCache] LOAD_ONLY_FROM_CACHE should not imply LOAD_PREFERRING_CACHE (Closed)
Patch Set: Always check vary Created 4 years, 2 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
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | net/base/load_flags_list.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/net/crn_http_protocol_handler.h" 5 #import "ios/net/crn_http_protocol_handler.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 load_flags |= LOAD_DO_NOT_SEND_COOKIES | LOAD_DO_NOT_SAVE_COOKIES; 595 load_flags |= LOAD_DO_NOT_SEND_COOKIES | LOAD_DO_NOT_SAVE_COOKIES;
596 596
597 // Cache flags. 597 // Cache flags.
598 if (tracker_) { 598 if (tracker_) {
599 RequestTracker::CacheMode cache_mode = tracker_->GetCacheMode(); 599 RequestTracker::CacheMode cache_mode = tracker_->GetCacheMode();
600 switch (cache_mode) { 600 switch (cache_mode) {
601 case RequestTracker::CACHE_RELOAD: 601 case RequestTracker::CACHE_RELOAD:
602 load_flags |= LOAD_VALIDATE_CACHE; 602 load_flags |= LOAD_VALIDATE_CACHE;
603 break; 603 break;
604 case RequestTracker::CACHE_HISTORY: 604 case RequestTracker::CACHE_HISTORY:
605 load_flags |= LOAD_PREFERRING_CACHE; 605 load_flags |= LOAD_SKIP_CACHE_VALIDATION;
606 break; 606 break;
607 case RequestTracker::CACHE_BYPASS: 607 case RequestTracker::CACHE_BYPASS:
608 load_flags |= LOAD_DISABLE_CACHE | LOAD_BYPASS_CACHE; 608 load_flags |= LOAD_DISABLE_CACHE | LOAD_BYPASS_CACHE;
609 break; 609 break;
610 case RequestTracker::CACHE_ONLY: 610 case RequestTracker::CACHE_ONLY:
611 load_flags |= LOAD_ONLY_FROM_CACHE; 611 load_flags |= LOAD_ONLY_FROM_CACHE | LOAD_SKIP_CACHE_VALIDATION;
612 break; 612 break;
613 case RequestTracker::CACHE_NORMAL: 613 case RequestTracker::CACHE_NORMAL:
614 // Do nothing, normal load. 614 // Do nothing, normal load.
615 break; 615 break;
616 } 616 }
617 } else { 617 } else {
618 switch ([request_ cachePolicy]) { 618 switch ([request_ cachePolicy]) {
619 case NSURLRequestReloadIgnoringLocalAndRemoteCacheData: 619 case NSURLRequestReloadIgnoringLocalAndRemoteCacheData:
620 load_flags |= LOAD_BYPASS_CACHE; 620 load_flags |= LOAD_BYPASS_CACHE;
621 case NSURLRequestReloadIgnoringLocalCacheData: 621 case NSURLRequestReloadIgnoringLocalCacheData:
622 load_flags |= LOAD_DISABLE_CACHE; 622 load_flags |= LOAD_DISABLE_CACHE;
623 break; 623 break;
624 case NSURLRequestReturnCacheDataElseLoad: 624 case NSURLRequestReturnCacheDataElseLoad:
625 load_flags |= LOAD_PREFERRING_CACHE; 625 load_flags |= LOAD_SKIP_CACHE_VALIDATION;
626 break; 626 break;
627 case NSURLRequestReturnCacheDataDontLoad: 627 case NSURLRequestReturnCacheDataDontLoad:
628 load_flags |= LOAD_ONLY_FROM_CACHE; 628 load_flags |= LOAD_ONLY_FROM_CACHE | LOAD_SKIP_CACHE_VALIDATION;
629 break; 629 break;
630 case NSURLRequestReloadRevalidatingCacheData: 630 case NSURLRequestReloadRevalidatingCacheData:
631 load_flags |= LOAD_VALIDATE_CACHE; 631 load_flags |= LOAD_VALIDATE_CACHE;
632 break; 632 break;
633 case NSURLRequestUseProtocolCachePolicy: 633 case NSURLRequestUseProtocolCachePolicy:
634 // Do nothing, normal load. 634 // Do nothing, normal load.
635 break; 635 break;
636 } 636 }
637 } 637 }
638 net_request_->SetLoadFlags(load_flags); 638 net_request_->SetLoadFlags(load_flags);
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 [[DeferredCancellation alloc] initWithCore:[self getCore]]; 1095 [[DeferredCancellation alloc] initWithCore:[self getCore]];
1096 NSArray* modes = @[ [[NSRunLoop currentRunLoop] currentMode] ]; 1096 NSArray* modes = @[ [[NSRunLoop currentRunLoop] currentMode] ];
1097 [cancellation performSelector:@selector(cancel) 1097 [cancellation performSelector:@selector(cancel)
1098 onThread:[self getClientThread] 1098 onThread:[self getClientThread]
1099 withObject:nil 1099 withObject:nil
1100 waitUntilDone:NO 1100 waitUntilDone:NO
1101 modes:modes]; 1101 modes:modes];
1102 } 1102 }
1103 1103
1104 @end 1104 @end
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | net/base/load_flags_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698