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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 465363003: ResourceScheduler get visual signal from RenderViewHostImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Do not throttle when should not Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "content/browser/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } else { 207 } else {
208 rvh_state_ = STATE_DEFAULT; 208 rvh_state_ = STATE_DEFAULT;
209 instance_->increment_active_view_count(); 209 instance_->increment_active_view_count();
210 } 210 }
211 211
212 if (ResourceDispatcherHostImpl::Get()) { 212 if (ResourceDispatcherHostImpl::Get()) {
213 BrowserThread::PostTask( 213 BrowserThread::PostTask(
214 BrowserThread::IO, FROM_HERE, 214 BrowserThread::IO, FROM_HERE,
215 base::Bind(&ResourceDispatcherHostImpl::OnRenderViewHostCreated, 215 base::Bind(&ResourceDispatcherHostImpl::OnRenderViewHostCreated,
216 base::Unretained(ResourceDispatcherHostImpl::Get()), 216 base::Unretained(ResourceDispatcherHostImpl::Get()),
217 GetProcess()->GetID(), GetRoutingID())); 217 GetProcess()->GetID(), GetRoutingID(), !is_hidden()));
218 } 218 }
219 219
220 #if defined(ENABLE_BROWSER_CDMS) 220 #if defined(ENABLE_BROWSER_CDMS)
221 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); 221 media_web_contents_observer_.reset(new MediaWebContentsObserver(this));
222 #endif 222 #endif
223 223
224 unload_event_monitor_timeout_.reset(new TimeoutMonitor(base::Bind( 224 unload_event_monitor_timeout_.reset(new TimeoutMonitor(base::Bind(
225 &RenderViewHostImpl::OnSwappedOut, weak_factory_.GetWeakPtr(), true))); 225 &RenderViewHostImpl::OnSwappedOut, weak_factory_.GetWeakPtr(), true)));
226 } 226 }
227 227
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 if (GetProcess()->HasConnection()) { 946 if (GetProcess()->HasConnection()) {
947 RenderProcessHostImpl::ReleaseOnCloseACK( 947 RenderProcessHostImpl::ReleaseOnCloseACK(
948 GetProcess(), 948 GetProcess(),
949 delegate_->GetSessionStorageNamespaceMap(), 949 delegate_->GetSessionStorageNamespaceMap(),
950 GetRoutingID()); 950 GetRoutingID());
951 } 951 }
952 952
953 RenderWidgetHostImpl::Shutdown(); 953 RenderWidgetHostImpl::Shutdown();
954 } 954 }
955 955
956 void RenderViewHostImpl::WasHidden() {
957 if (ResourceDispatcherHostImpl::Get()) {
958 BrowserThread::PostTask(
959 BrowserThread::IO, FROM_HERE,
960 base::Bind(&ResourceDispatcherHostImpl::OnRenderViewHostWasHidden,
961 base::Unretained(ResourceDispatcherHostImpl::Get()),
962 GetProcess()->GetID(), GetRoutingID()));
963 }
964
965 RenderWidgetHostImpl::WasHidden();
966 }
967
968 void RenderViewHostImpl::WasShown(const ui::LatencyInfo& latency_info) {
969 if (ResourceDispatcherHostImpl::Get()) {
970 BrowserThread::PostTask(
971 BrowserThread::IO, FROM_HERE,
972 base::Bind(&ResourceDispatcherHostImpl::OnRenderViewHostWasShown,
973 base::Unretained(ResourceDispatcherHostImpl::Get()),
974 GetProcess()->GetID(), GetRoutingID()));
975 }
976
977 RenderWidgetHostImpl::WasShown(latency_info);
978 }
979
956 bool RenderViewHostImpl::IsRenderView() const { 980 bool RenderViewHostImpl::IsRenderView() const {
957 return true; 981 return true;
958 } 982 }
959 983
960 void RenderViewHostImpl::CreateNewWindow( 984 void RenderViewHostImpl::CreateNewWindow(
961 int route_id, 985 int route_id,
962 int main_frame_route_id, 986 int main_frame_route_id,
963 const ViewHostMsg_CreateWindow_Params& params, 987 const ViewHostMsg_CreateWindow_Params& params,
964 SessionStorageNamespace* session_storage_namespace) { 988 SessionStorageNamespace* session_storage_namespace) {
965 ViewHostMsg_CreateWindow_Params validated_params(params); 989 ViewHostMsg_CreateWindow_Params validated_params(params);
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 FrameTree* frame_tree = delegate_->GetFrameTree(); 1556 FrameTree* frame_tree = delegate_->GetFrameTree();
1533 1557
1534 frame_tree->ResetForMainFrameSwap(); 1558 frame_tree->ResetForMainFrameSwap();
1535 } 1559 }
1536 1560
1537 void RenderViewHostImpl::SelectWordAroundCaret() { 1561 void RenderViewHostImpl::SelectWordAroundCaret() {
1538 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); 1562 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID()));
1539 } 1563 }
1540 1564
1541 } // namespace content 1565 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.h ('k') | content/browser/renderer_host/render_widget_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698