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

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

Issue 1015243004: Move load progress tracking logic to the frame tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Readding TODO Created 5 years, 9 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/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 case blink::WebTextDirectionRightToLeft: 98 case blink::WebTextDirectionRightToLeft:
99 return base::i18n::RIGHT_TO_LEFT; 99 return base::i18n::RIGHT_TO_LEFT;
100 default: 100 default:
101 NOTREACHED(); 101 NOTREACHED();
102 return base::i18n::UNKNOWN_DIRECTION; 102 return base::i18n::UNKNOWN_DIRECTION;
103 } 103 }
104 } 104 }
105 105
106 } // namespace 106 } // namespace
107 107
108 const double RenderFrameHostImpl::kLoadingProgressNotStarted = 0.0;
109 const double RenderFrameHostImpl::kLoadingProgressMinimum = 0.1;
110 const double RenderFrameHostImpl::kLoadingProgressDone = 1.0;
111
112 // static 108 // static
113 bool RenderFrameHostImpl::IsRFHStateActive(RenderFrameHostImplState rfh_state) { 109 bool RenderFrameHostImpl::IsRFHStateActive(RenderFrameHostImplState rfh_state) {
114 return rfh_state == STATE_DEFAULT; 110 return rfh_state == STATE_DEFAULT;
115 } 111 }
116 112
117 // static 113 // static
118 RenderFrameHost* RenderFrameHost::FromID(int render_process_id, 114 RenderFrameHost* RenderFrameHost::FromID(int render_process_id,
119 int render_frame_id) { 115 int render_frame_id) {
120 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id); 116 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
121 } 117 }
(...skipping 23 matching lines...) Expand all
145 cross_process_frame_connector_(NULL), 141 cross_process_frame_connector_(NULL),
146 render_frame_proxy_host_(NULL), 142 render_frame_proxy_host_(NULL),
147 frame_tree_(frame_tree), 143 frame_tree_(frame_tree),
148 frame_tree_node_(frame_tree_node), 144 frame_tree_node_(frame_tree_node),
149 routing_id_(routing_id), 145 routing_id_(routing_id),
150 render_frame_created_(false), 146 render_frame_created_(false),
151 navigations_suspended_(false), 147 navigations_suspended_(false),
152 is_waiting_for_beforeunload_ack_(false), 148 is_waiting_for_beforeunload_ack_(false),
153 unload_ack_is_for_navigation_(false), 149 unload_ack_is_for_navigation_(false),
154 is_loading_(false), 150 is_loading_(false),
155 loading_progress_(kLoadingProgressNotStarted),
156 accessibility_reset_token_(0), 151 accessibility_reset_token_(0),
157 accessibility_reset_count_(0), 152 accessibility_reset_count_(0),
158 no_create_browser_accessibility_manager_for_testing_(false), 153 no_create_browser_accessibility_manager_for_testing_(false),
159 weak_ptr_factory_(this) { 154 weak_ptr_factory_(this) {
160 bool is_swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT); 155 bool is_swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT);
161 bool hidden = !!(flags & CREATE_RF_HIDDEN); 156 bool hidden = !!(flags & CREATE_RF_HIDDEN);
162 frame_tree_->RegisterRenderFrameHost(this); 157 frame_tree_->RegisterRenderFrameHost(this);
163 GetProcess()->AddRoute(routing_id_, this); 158 GetProcess()->AddRoute(routing_id_, this);
164 g_routing_id_frame_map.Get().insert(std::make_pair( 159 g_routing_id_frame_map.Get().insert(std::make_pair(
165 RenderFrameHostID(GetProcess()->GetID(), routing_id_), 160 RenderFrameHostID(GetProcess()->GetID(), routing_id_),
(...skipping 1782 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 void RenderFrameHostImpl::DidUseGeolocationPermission() { 1943 void RenderFrameHostImpl::DidUseGeolocationPermission() {
1949 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); 1944 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame();
1950 GetContentClient()->browser()->RegisterPermissionUsage( 1945 GetContentClient()->browser()->RegisterPermissionUsage(
1951 PERMISSION_GEOLOCATION, 1946 PERMISSION_GEOLOCATION,
1952 delegate_->GetAsWebContents(), 1947 delegate_->GetAsWebContents(),
1953 GetLastCommittedURL().GetOrigin(), 1948 GetLastCommittedURL().GetOrigin(),
1954 top_frame->GetLastCommittedURL().GetOrigin()); 1949 top_frame->GetLastCommittedURL().GetOrigin());
1955 } 1950 }
1956 1951
1957 } // namespace content 1952 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698