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

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

Issue 1310743003: Consistently use LoFi for an entire page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test comment fixes Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 namespace content { 45 namespace content {
46 46
47 namespace { 47 namespace {
48 48
49 FrameMsg_Navigate_Type::Value GetNavigationType( 49 FrameMsg_Navigate_Type::Value GetNavigationType(
50 BrowserContext* browser_context, const NavigationEntryImpl& entry, 50 BrowserContext* browser_context, const NavigationEntryImpl& entry,
51 NavigationController::ReloadType reload_type) { 51 NavigationController::ReloadType reload_type) {
52 switch (reload_type) { 52 switch (reload_type) {
53 case NavigationControllerImpl::RELOAD: 53 case NavigationControllerImpl::RELOAD:
54 case NavigationControllerImpl::RELOAD_DISABLE_LOFI_MODE:
54 return FrameMsg_Navigate_Type::RELOAD; 55 return FrameMsg_Navigate_Type::RELOAD;
55 case NavigationControllerImpl::RELOAD_IGNORING_CACHE: 56 case NavigationControllerImpl::RELOAD_IGNORING_CACHE:
56 return FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE; 57 return FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE;
57 case NavigationControllerImpl::RELOAD_ORIGINAL_REQUEST_URL: 58 case NavigationControllerImpl::RELOAD_ORIGINAL_REQUEST_URL:
58 return FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL; 59 return FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL;
59 case NavigationControllerImpl::NO_RELOAD: 60 case NavigationControllerImpl::NO_RELOAD:
60 break; // Fall through to rest of function. 61 break; // Fall through to rest of function.
61 } 62 }
62 63
63 // |RenderViewImpl::PopulateStateFromPendingNavigationParams| differentiates 64 // |RenderViewImpl::PopulateStateFromPendingNavigationParams| differentiates
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 bool is_transfer_to_same = 328 bool is_transfer_to_same =
328 entry.transferred_global_request_id().child_id != -1 && 329 entry.transferred_global_request_id().child_id != -1 &&
329 entry.transferred_global_request_id().child_id == 330 entry.transferred_global_request_id().child_id ==
330 dest_render_frame_host->GetProcess()->GetID(); 331 dest_render_frame_host->GetProcess()->GetID();
331 if (!is_transfer_to_same) { 332 if (!is_transfer_to_same) {
332 navigation_data_.reset(new NavigationMetricsData(navigation_start, dest_url, 333 navigation_data_.reset(new NavigationMetricsData(navigation_start, dest_url,
333 entry.restore_type())); 334 entry.restore_type()));
334 // Create the navigation parameters. 335 // Create the navigation parameters.
335 FrameMsg_Navigate_Type::Value navigation_type = 336 FrameMsg_Navigate_Type::Value navigation_type =
336 GetNavigationType(controller_->GetBrowserContext(), entry, reload_type); 337 GetNavigationType(controller_->GetBrowserContext(), entry, reload_type);
338 LoFiState lofi_state =
339 (reload_type ==
340 NavigationController::ReloadType::RELOAD_DISABLE_LOFI_MODE
341 ? LOFI_OFF
342 : LOFI_UNSPECIFIED);
337 dest_render_frame_host->Navigate( 343 dest_render_frame_host->Navigate(
338 entry.ConstructCommonNavigationParams(dest_url, dest_referrer, 344 entry.ConstructCommonNavigationParams(
339 frame_entry, navigation_type), 345 dest_url, dest_referrer, frame_entry, navigation_type, lofi_state),
340 entry.ConstructStartNavigationParams(), 346 entry.ConstructStartNavigationParams(),
341 entry.ConstructRequestNavigationParams( 347 entry.ConstructRequestNavigationParams(
342 frame_entry, navigation_start, is_same_document_history_load, 348 frame_entry, navigation_start, is_same_document_history_load,
343 frame_tree_node->has_committed_real_load(), 349 frame_tree_node->has_committed_real_load(),
344 controller_->GetPendingEntryIndex() == -1, 350 controller_->GetPendingEntryIndex() == -1,
345 controller_->GetIndexOfEntry(&entry), 351 controller_->GetIndexOfEntry(&entry),
346 controller_->GetLastCommittedEntryIndex(), 352 controller_->GetLastCommittedEntryIndex(),
347 controller_->GetEntryCount())); 353 controller_->GetEntryCount()));
348 } else { 354 } else {
349 // No need to navigate again. Just resume the deferred request. 355 // No need to navigate again. Just resume the deferred request.
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 entry->set_should_replace_entry(pending_entry->should_replace_entry()); 952 entry->set_should_replace_entry(pending_entry->should_replace_entry());
947 entry->SetRedirectChain(pending_entry->GetRedirectChain()); 953 entry->SetRedirectChain(pending_entry->GetRedirectChain());
948 } 954 }
949 controller_->SetPendingEntry(entry.Pass()); 955 controller_->SetPendingEntry(entry.Pass());
950 if (delegate_) 956 if (delegate_)
951 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); 957 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
952 } 958 }
953 } 959 }
954 960
955 } // namespace content 961 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698