diff options
author | hshi@chromium.org <hshi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-19 03:22:22 +0000 |
---|---|---|
committer | hshi@chromium.org <hshi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-19 03:22:22 +0000 |
commit | b0a8faa7613b7e98ec8c6e7cebbd436a319fceb1 (patch) | |
tree | 911d34b7981099cf1fc7e71e8d21a541b3698e52 | |
parent | a54c1c8ca724a74b0ba4d2f8ee20a8097be2201b (diff) | |
download | chromium_src-b0a8faa7613b7e98ec8c6e7cebbd436a319fceb1.zip chromium_src-b0a8faa7613b7e98ec8c6e7cebbd436a319fceb1.tar.gz chromium_src-b0a8faa7613b7e98ec8c6e7cebbd436a319fceb1.tar.bz2 |
Ash: fix a crash with MetricsLogs accessing a deleted AshScreen pointer.
Make the AshScreen* screen_ a leaky object and annotate it as such to
suppress valgrind warnings.
The rationale is that it is a small structure and it is only leaked at
shutdown anyway.
BUG=156466
TEST=CQ
Review URL: https://chromiumcodereview.appspot.com/11193044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162904 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ash/shell.cc | 6 | ||||
-rw-r--r-- | ash/shell.h | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/ash/shell.cc b/ash/shell.cc index dcdf32f..2ceb23f 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -62,6 +62,7 @@ #include "ash/wm/workspace_controller.h" #include "base/bind.h" #include "base/command_line.h" +#include "base/debug/leak_annotations.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/user_action_client.h" #include "ui/aura/display_manager.h" @@ -188,8 +189,9 @@ Shell::Shell(ShellDelegate* delegate) #endif // defined(OS_CHROMEOS) browser_context_(NULL), simulate_modal_window_open_for_testing_(false) { - gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); - gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_.get()); + ANNOTATE_LEAKING_OBJECT_PTR(screen_); // see crbug.com/156466 + gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_); + gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_); ui_controls::InstallUIControlsAura(internal::CreateUIControls()); #if defined(OS_CHROMEOS) content::GpuFeatureType blacklisted_features = diff --git a/ash/shell.h b/ash/shell.h index 5263923..05dc2b8 100644 --- a/ash/shell.h +++ b/ash/shell.h @@ -325,7 +325,7 @@ class ASH_EXPORT Shell : internal::SystemModalContainerEventFilterDelegate{ return magnification_controller_.get(); } - const ScreenAsh* screen() { return screen_.get(); } + const ScreenAsh* screen() { return screen_; } // Force the shelf to query for it's current visibility state. void UpdateShelfVisibility(); @@ -420,7 +420,7 @@ class ASH_EXPORT Shell : internal::SystemModalContainerEventFilterDelegate{ // when the screen is initially created. static bool initially_hide_cursor_; - scoped_ptr<ScreenAsh> screen_; + ScreenAsh* screen_; // Active root window. Never becomes NULL during the session. aura::RootWindow* active_root_window_; |