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

Side by Side Diff: chrome/browser/render_widget_host_view_win.cc

Issue 7638: Construct a field trial to see if HIGH or MEDIUM memory model "works better"... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/browser_trial.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/browser/render_widget_host_view_win.h" 5 #include "chrome/browser/render_widget_host_view_win.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/gfx/gdi_util.h" 8 #include "base/gfx/gdi_util.h"
9 #include "base/gfx/rect.h" 9 #include "base/gfx/rect.h"
10 #include "base/histogram.h" 10 #include "base/histogram.h"
11 #include "base/win_util.h" 11 #include "base/win_util.h"
12 #include "chrome/browser/browser_accessibility.h" 12 #include "chrome/browser/browser_accessibility.h"
13 #include "chrome/browser/browser_accessibility_manager.h" 13 #include "chrome/browser/browser_accessibility_manager.h"
14 #include "chrome/browser/browser_trial.h"
14 #include "chrome/browser/render_process_host.h" 15 #include "chrome/browser/render_process_host.h"
15 // TODO(beng): (Cleanup) we should not need to include this file... see comment 16 // TODO(beng): (Cleanup) we should not need to include this file... see comment
16 // in |DidBecomeSelected|. 17 // in |DidBecomeSelected|.
17 #include "chrome/browser/render_view_host.h" 18 #include "chrome/browser/render_view_host.h"
18 #include "chrome/browser/render_widget_host.h" 19 #include "chrome/browser/render_widget_host.h"
19 #include "chrome/common/chrome_constants.h" 20 #include "chrome/common/chrome_constants.h"
20 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
21 #include "chrome/common/l10n_util.h" 22 #include "chrome/common/l10n_util.h"
22 #include "chrome/common/plugin_messages.h" 23 #include "chrome/common/plugin_messages.h"
23 #include "chrome/common/win_util.h" 24 #include "chrome/common/win_util.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 if (damaged_rect.bottom() > bitmap_rect.bottom()) { 427 if (damaged_rect.bottom() > bitmap_rect.bottom()) {
427 RECT r; 428 RECT r;
428 r.left = damaged_rect.x(); 429 r.left = damaged_rect.x();
429 r.right = damaged_rect.right(); 430 r.right = damaged_rect.right();
430 r.top = std::max(bitmap_rect.bottom(), damaged_rect.y()); 431 r.top = std::max(bitmap_rect.bottom(), damaged_rect.y());
431 r.bottom = damaged_rect.bottom(); 432 r.bottom = damaged_rect.bottom();
432 paint_dc.FillRect(&r, white_brush); 433 paint_dc.FillRect(&r, white_brush);
433 } 434 }
434 if (!whiteout_start_time_.is_null()) { 435 if (!whiteout_start_time_.is_null()) {
435 TimeDelta whiteout_duration = TimeTicks::Now() - whiteout_start_time_; 436 TimeDelta whiteout_duration = TimeTicks::Now() - whiteout_start_time_;
436 UMA_HISTOGRAM_TIMES(L"MPArch.RWHH_WhiteoutDuration", whiteout_duration); 437
438 // If field trial is active, report results in special histogram.
439 static scoped_refptr<FieldTrial> trial(
440 FieldTrialList::Find(BrowserTrial::kMemoryModelFieldTrial));
441 if (trial.get()) {
442 if (trial->boolean_value())
443 UMA_HISTOGRAM_TIMES(L"MPArch.RWHH_WhiteoutDuration_trial_high_memory",
444 whiteout_duration);
445 else
446 UMA_HISTOGRAM_TIMES(L"MPArch.RWHH_WhiteoutDuration_trial_med_memory",
447 whiteout_duration);
448 } else {
449 UMA_HISTOGRAM_TIMES(L"MPArch.RWHH_WhiteoutDuration", whiteout_duration);
450 }
451
437 // Reset the start time to 0 so that we start recording again the next 452 // Reset the start time to 0 so that we start recording again the next
438 // time the backing store is NULL... 453 // time the backing store is NULL...
439 whiteout_start_time_ = TimeTicks(); 454 whiteout_start_time_ = TimeTicks();
440 } 455 }
441 } else { 456 } else {
442 paint_dc.FillRect(&paint_dc.m_ps.rcPaint, white_brush); 457 paint_dc.FillRect(&paint_dc.m_ps.rcPaint, white_brush);
443 if (whiteout_start_time_.is_null()) 458 if (whiteout_start_time_.is_null())
444 whiteout_start_time_ = TimeTicks::Now(); 459 whiteout_start_time_ = TimeTicks::Now();
445 } 460 }
446 } 461 }
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 ::DestroyWindow(tooltip_hwnd_); 900 ::DestroyWindow(tooltip_hwnd_);
886 tooltip_hwnd_ = NULL; 901 tooltip_hwnd_ = NULL;
887 } 902 }
888 903
889 void RenderWidgetHostViewWin::ShutdownHost() { 904 void RenderWidgetHostViewWin::ShutdownHost() {
890 shutdown_factory_.RevokeAll(); 905 shutdown_factory_.RevokeAll();
891 render_widget_host_->Shutdown(); 906 render_widget_host_->Shutdown();
892 // Do not touch any members at this point, |this| has been deleted. 907 // Do not touch any members at this point, |this| has been deleted.
893 } 908 }
894 909
OLDNEW
« no previous file with comments | « chrome/browser/browser_trial.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698