diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-24 18:11:39 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-24 18:11:39 +0000 |
commit | 770dd8b8b1ee5adc67ed257e53d3f34c7e67b02e (patch) | |
tree | e0894895aa1152dd152459657f4e0de497195d51 /chrome/browser/tab_contents | |
parent | d5fa6fd614049dcacb22ab9034eaf2b892a17e85 (diff) | |
download | chromium_src-770dd8b8b1ee5adc67ed257e53d3f34c7e67b02e.zip chromium_src-770dd8b8b1ee5adc67ed257e53d3f34c7e67b02e.tar.gz chromium_src-770dd8b8b1ee5adc67ed257e53d3f34c7e67b02e.tar.bz2 |
Mac: Fix renderer idle cpu usage regression.
Since polling is required only for the preferred height and mac only needs preferred width, add a flag that specifies if the client is interested in width and/or height.
This is a band-aid, the Real Fix is tracked in 44850.
BUG=44494
TEST=Open chrome's task manager. Idle renderer processes should take close to 0 %cpu instead of ~1.5 before.
Review URL: http://codereview.chromium.org/2145002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48056 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 6 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_view_mac.mm | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 3e38fe0..f3160cc 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -789,8 +789,10 @@ bool TabContents::NavigateToPendingEntry( if (!dest_render_view_host) return false; // Unable to create the desired render view host. - if (delegate_ && delegate_->ShouldEnablePreferredSizeNotifications()) - dest_render_view_host->EnablePreferredSizeChangedMode(); + if (delegate_ && delegate_->ShouldEnablePreferredSizeNotifications()) { + dest_render_view_host->EnablePreferredSizeChangedMode( + kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow); + } // For security, we should never send non-DOM-UI URLs (other than about:blank) // to a DOM UI renderer. Double check that here. diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm index 92cbe2d..9de79b9 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac.mm +++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm @@ -154,10 +154,10 @@ void TabContentsViewMac::StartDragging( } void TabContentsViewMac::RenderViewCreated(RenderViewHost* host) { - // We want updates whenever the intrinsic width of the webpage - // changes. Put the RenderView into that mode. - int routing_id = host->routing_id(); - host->Send(new ViewMsg_EnablePreferredSizeChangedMode(routing_id)); + // We want updates whenever the intrinsic width of the webpage changes. + // Put the RenderView into that mode. The preferred width is used for example + // when the "zoom" button in the browser window is clicked. + host->EnablePreferredSizeChangedMode(kPreferredSizeWidth); } void TabContentsViewMac::SetPageTitle(const std::wstring& title) { |