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

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

Issue 2484633004: Change Lo-Fi bool to bitmask to support multiple Previews types (Closed)
Patch Set: rebase Created 4 years 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/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 pending_commit_(false), 326 pending_commit_(false),
327 nav_entry_id_(0), 327 nav_entry_id_(0),
328 accessibility_reset_token_(0), 328 accessibility_reset_token_(0),
329 accessibility_reset_count_(0), 329 accessibility_reset_count_(0),
330 browser_plugin_embedder_ax_tree_id_(AXTreeIDRegistry::kNoAXTreeID), 330 browser_plugin_embedder_ax_tree_id_(AXTreeIDRegistry::kNoAXTreeID),
331 no_create_browser_accessibility_manager_for_testing_(false), 331 no_create_browser_accessibility_manager_for_testing_(false),
332 web_ui_type_(WebUI::kNoWebUI), 332 web_ui_type_(WebUI::kNoWebUI),
333 pending_web_ui_type_(WebUI::kNoWebUI), 333 pending_web_ui_type_(WebUI::kNoWebUI),
334 should_reuse_web_ui_(false), 334 should_reuse_web_ui_(false),
335 has_selection_(false), 335 has_selection_(false),
336 last_navigation_lofi_state_(LOFI_UNSPECIFIED), 336 last_navigation_previews_state_(PREVIEWS_UNSPECIFIED),
337 frame_host_binding_(this), 337 frame_host_binding_(this),
338 waiting_for_init_(renderer_initiated_creation), 338 waiting_for_init_(renderer_initiated_creation),
339 weak_ptr_factory_(this) { 339 weak_ptr_factory_(this) {
340 frame_tree_->AddRenderViewHostRef(render_view_host_); 340 frame_tree_->AddRenderViewHostRef(render_view_host_);
341 GetProcess()->AddRoute(routing_id_, this); 341 GetProcess()->AddRoute(routing_id_, this);
342 g_routing_id_frame_map.Get().insert(std::make_pair( 342 g_routing_id_frame_map.Get().insert(std::make_pair(
343 RenderFrameHostID(GetProcess()->GetID(), routing_id_), 343 RenderFrameHostID(GetProcess()->GetID(), routing_id_),
344 this)); 344 this));
345 site_instance_->AddObserver(this); 345 site_instance_->AddObserver(this);
346 GetSiteInstance()->IncrementActiveFrameCount(); 346 GetSiteInstance()->IncrementActiveFrameCount();
(...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after
2387 // done here either. 2387 // done here either.
2388 if (!common_params.url.SchemeIs(url::kJavaScriptScheme)) 2388 if (!common_params.url.SchemeIs(url::kJavaScriptScheme))
2389 OnDidStartLoading(true); 2389 OnDidStartLoading(true);
2390 } 2390 }
2391 2391
2392 void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) { 2392 void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) {
2393 DCHECK(data_url.SchemeIs(url::kDataScheme)); 2393 DCHECK(data_url.SchemeIs(url::kDataScheme));
2394 CommonNavigationParams common_params( 2394 CommonNavigationParams common_params(
2395 data_url, Referrer(), ui::PAGE_TRANSITION_LINK, 2395 data_url, Referrer(), ui::PAGE_TRANSITION_LINK,
2396 FrameMsg_Navigate_Type::NORMAL, false, false, base::TimeTicks::Now(), 2396 FrameMsg_Navigate_Type::NORMAL, false, false, base::TimeTicks::Now(),
2397 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), LOFI_OFF, 2397 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), PREVIEWS_OFF,
2398 base::TimeTicks::Now(), "GET", nullptr); 2398 base::TimeTicks::Now(), "GET", nullptr);
2399 if (IsBrowserSideNavigationEnabled()) { 2399 if (IsBrowserSideNavigationEnabled()) {
2400 CommitNavigation(nullptr, nullptr, common_params, RequestNavigationParams(), 2400 CommitNavigation(nullptr, nullptr, common_params, RequestNavigationParams(),
2401 false); 2401 false);
2402 } else { 2402 } else {
2403 Navigate(common_params, StartNavigationParams(), RequestNavigationParams()); 2403 Navigate(common_params, StartNavigationParams(), RequestNavigationParams());
2404 } 2404 }
2405 } 2405 }
2406 2406
2407 void RenderFrameHostImpl::Stop() { 2407 void RenderFrameHostImpl::Stop() {
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2571 DCHECK(!GetParent()); 2571 DCHECK(!GetParent());
2572 render_view_host()->Send(new FrameMsg_EnableViewSourceMode(routing_id_)); 2572 render_view_host()->Send(new FrameMsg_EnableViewSourceMode(routing_id_));
2573 } 2573 }
2574 2574
2575 const GURL body_url = body.get() ? body->GetURL() : GURL(); 2575 const GURL body_url = body.get() ? body->GetURL() : GURL();
2576 const ResourceResponseHead head = response ? 2576 const ResourceResponseHead head = response ?
2577 response->head : ResourceResponseHead(); 2577 response->head : ResourceResponseHead();
2578 Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, common_params, 2578 Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, common_params,
2579 request_params)); 2579 request_params));
2580 2580
2581 // If a network request was made, update the LoFi state. 2581 // If a network request was made, update the Previews state.
2582 if (ShouldMakeNetworkRequestForURL(common_params.url)) 2582 if (ShouldMakeNetworkRequestForURL(common_params.url))
2583 last_navigation_lofi_state_ = common_params.lofi_state; 2583 last_navigation_previews_state_ = common_params.previews_state;
2584 2584
2585 // TODO(clamy): Release the stream handle once the renderer has finished 2585 // TODO(clamy): Release the stream handle once the renderer has finished
2586 // reading it. 2586 // reading it.
2587 stream_handle_ = std::move(body); 2587 stream_handle_ = std::move(body);
2588 2588
2589 // When navigating to a debug url, no commit is expected from the 2589 // When navigating to a debug url, no commit is expected from the
2590 // RenderFrameHost, nor should the throbber start. The NavigationRequest is 2590 // RenderFrameHost, nor should the throbber start. The NavigationRequest is
2591 // also not stored in the FrameTreeNode. Therefore do not reset it, as this 2591 // also not stored in the FrameTreeNode. Therefore do not reset it, as this
2592 // could cancel an existing pending navigation. 2592 // could cancel an existing pending navigation.
2593 if (!IsRendererDebugURL(common_params.url)) { 2593 if (!IsRendererDebugURL(common_params.url)) {
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
3316 // There is no pending NavigationEntry in these cases, so pass 0 as the 3316 // There is no pending NavigationEntry in these cases, so pass 0 as the
3317 // pending_nav_entry_id. If the previous handle was a prematurely aborted 3317 // pending_nav_entry_id. If the previous handle was a prematurely aborted
3318 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. 3318 // navigation loaded via LoadDataWithBaseURL, propagate the entry id.
3319 return NavigationHandleImpl::Create( 3319 return NavigationHandleImpl::Create(
3320 params.url, frame_tree_node_, is_renderer_initiated, 3320 params.url, frame_tree_node_, is_renderer_initiated,
3321 params.was_within_same_page, base::TimeTicks::Now(), 3321 params.was_within_same_page, base::TimeTicks::Now(),
3322 entry_id_for_data_nav, false); // started_from_context_menu 3322 entry_id_for_data_nav, false); // started_from_context_menu
3323 } 3323 }
3324 3324
3325 } // namespace content 3325 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698