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

Side by Side Diff: content/browser/frame_host/navigation_request.cc

Issue 2695713011: PlzNavigate: set the right cache policy on back POST navigations (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "content/browser/frame_host/navigation_request.h" 5 #include "content/browser/frame_host/navigation_request.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "content/browser/appcache/appcache_navigation_handle.h" 10 #include "content/browser/appcache/appcache_navigation_handle.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 break; 68 break;
69 case FrameMsg_Navigate_Type::RESTORE: 69 case FrameMsg_Navigate_Type::RESTORE:
70 *load_flags |= net::LOAD_SKIP_CACHE_VALIDATION; 70 *load_flags |= net::LOAD_SKIP_CACHE_VALIDATION;
71 break; 71 break;
72 case FrameMsg_Navigate_Type::RESTORE_WITH_POST: 72 case FrameMsg_Navigate_Type::RESTORE_WITH_POST:
73 *load_flags |= 73 *load_flags |=
74 net::LOAD_ONLY_FROM_CACHE | net::LOAD_SKIP_CACHE_VALIDATION; 74 net::LOAD_ONLY_FROM_CACHE | net::LOAD_SKIP_CACHE_VALIDATION;
75 break; 75 break;
76 case FrameMsg_Navigate_Type::SAME_DOCUMENT: 76 case FrameMsg_Navigate_Type::SAME_DOCUMENT:
77 case FrameMsg_Navigate_Type::DIFFERENT_DOCUMENT: 77 case FrameMsg_Navigate_Type::DIFFERENT_DOCUMENT:
78 if (is_post)
79 *load_flags |= net::LOAD_VALIDATE_CACHE;
80 break;
78 case FrameMsg_Navigate_Type::HISTORY_SAME_DOCUMENT: 81 case FrameMsg_Navigate_Type::HISTORY_SAME_DOCUMENT:
79 case FrameMsg_Navigate_Type::HISTORY_DIFFERENT_DOCUMENT: 82 case FrameMsg_Navigate_Type::HISTORY_DIFFERENT_DOCUMENT:
80 if (is_post) 83 if (is_post) {
81 *load_flags |= net::LOAD_VALIDATE_CACHE; 84 *load_flags |=
85 net::LOAD_ONLY_FROM_CACHE | net::LOAD_SKIP_CACHE_VALIDATION;
86 }
82 break; 87 break;
83 } 88 }
84 } 89 }
85 90
86 // TODO(clamy): This should be function in FrameTreeNode. 91 // TODO(clamy): This should be function in FrameTreeNode.
87 bool IsSecureFrame(FrameTreeNode* frame) { 92 bool IsSecureFrame(FrameTreeNode* frame) {
88 while (frame) { 93 while (frame) {
89 if (!IsPotentiallyTrustworthyOrigin(frame->current_origin())) 94 if (!IsPotentiallyTrustworthyOrigin(frame->current_origin()))
90 return false; 95 return false;
91 frame = frame->parent(); 96 frame = frame->parent();
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); 732 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture);
728 733
729 render_frame_host->CommitNavigation(response_.get(), std::move(body_), 734 render_frame_host->CommitNavigation(response_.get(), std::move(body_),
730 common_params_, request_params_, 735 common_params_, request_params_,
731 is_view_source_); 736 is_view_source_);
732 737
733 frame_tree_node_->ResetNavigationRequest(true); 738 frame_tree_node_->ResetNavigationRequest(true);
734 } 739 }
735 740
736 } // namespace content 741 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698