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

Unified Diff: ui/touch_selection/touch_selection_menu_runner.cc

Issue 1173083002: Add DCHECKs for the touch selection menu runner singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/touch_selection/touch_selection_menu_runner.cc
diff --git a/ui/touch_selection/touch_selection_menu_runner.cc b/ui/touch_selection/touch_selection_menu_runner.cc
index 860a24be6065a80ab0fba68c4143bb6b68278c9b..bf70874a4825b562f057414305eb6aaa7f517f4c 100644
--- a/ui/touch_selection/touch_selection_menu_runner.cc
+++ b/ui/touch_selection/touch_selection_menu_runner.cc
@@ -4,6 +4,8 @@
#include "ui/touch_selection/touch_selection_menu_runner.h"
+#include "base/logging.h"
+
namespace ui {
namespace {
@@ -12,6 +14,7 @@ TouchSelectionMenuRunner* g_touch_selection_menu_runner = nullptr;
} // namespace
TouchSelectionMenuRunner::~TouchSelectionMenuRunner() {
+ DCHECK_EQ(this, g_touch_selection_menu_runner);
g_touch_selection_menu_runner = nullptr;
}
@@ -20,11 +23,7 @@ TouchSelectionMenuRunner* TouchSelectionMenuRunner::GetInstance() {
}
TouchSelectionMenuRunner::TouchSelectionMenuRunner() {
- // TODO(mohsen): Ideally we should DCHECK that |g_touch_selection_menu_runner|
- // is not set here, in order to make sure we don't create multiple menu
- // runners accidentally. Currently, this is not possible because we can have
- // multiple ViewsDelegate's at the same time which should not happen. See
- // crbug.com/492991.
+ DCHECK(!g_touch_selection_menu_runner);
g_touch_selection_menu_runner = this;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698