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

Unified Diff: ui/views/controls/menu/menu_controller.cc

Issue 2687753002: Revert MenuController Checks (Closed)
Patch Set: Created 3 years, 10 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 | « ui/views/controls/menu/menu_controller.h ('k') | ui/views/controls/menu/menu_runner_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_controller.cc
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index 4183b1a0ad948bb8b62cfddb19f1840dd4bc0f3a..37db59dfd9313ef7ac30b9dbc1b132207cbe56ea 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -433,12 +433,6 @@ MenuItemView* MenuController::Run(Widget* parent,
} else {
showing_ = true;
- // TODO(jonross): remove after tracking down the cause of
- // (crbug.com/683087).
- // If we are not showing we should be shutting down, this could lead to
- // incorrect delegate states.
- CHECK(!running_);
-
if (owner_)
owner_->RemoveObserver(this);
owner_ = parent;
@@ -476,10 +470,6 @@ MenuItemView* MenuController::Run(Widget* parent,
if (ViewsDelegate::GetInstance())
ViewsDelegate::GetInstance()->AddRef();
- // TODO(jonross): remove after tracking down the cause of (crbug.com/683087).
- // About to either exit and run async, or nest message loop.
- running_ = true;
-
if (async_run_)
return nullptr;
@@ -529,11 +519,6 @@ void MenuController::Cancel(ExitType type) {
SetSelection(NULL, SELECTION_UPDATE_IMMEDIATELY | SELECTION_EXIT);
if (!blocking_run_) {
- // TODO(jonross): remove after tracking down the cause of
- // (crbug.com/683087).
- bool nested = delegate_stack_.size() > 1;
- CHECK(!nested);
- base::WeakPtr<MenuController> this_ref = AsWeakPtr();
// If we didn't block the caller we need to notify the menu, which
// triggers deleting us.
DCHECK(selected);
@@ -541,7 +526,6 @@ void MenuController::Cancel(ExitType type) {
delegate_->OnMenuClosed(internal::MenuControllerDelegate::NOTIFY_DELEGATE,
selected->GetRootMenuItem(), accept_event_flags_);
// WARNING: the call to MenuClosed deletes us.
- CHECK(!this_ref);
return;
}
@@ -564,12 +548,6 @@ void MenuController::Cancel(ExitType type) {
void MenuController::AddNestedDelegate(
internal::MenuControllerDelegate* delegate) {
- // TODO(jonross): remove after tracking down the cause of (crbug.com/683087).
- for (auto delegates : delegate_stack_) {
- // Having the same delegate in the stack could cause deletion order issues.
- CHECK_NE(delegates.first, delegate);
- }
-
delegate_stack_.push_back(std::make_pair(delegate, async_run_));
delegate_ = delegate;
}
@@ -1005,13 +983,9 @@ int MenuController::OnPerformDrop(SubmenuView* source,
drop_target = drop_target->GetParentMenuItem();
if (!IsBlockingRun()) {
- // TODO(jonross): remove after tracking down the cause of
- // (crbug.com/683087).
- base::WeakPtr<MenuController> this_ref = AsWeakPtr();
delegate_->OnMenuClosed(
internal::MenuControllerDelegate::DONT_NOTIFY_DELEGATE,
item->GetRootMenuItem(), accept_event_flags_);
- CHECK(!this_ref);
}
// WARNING: the call to MenuClosed deletes us.
@@ -1410,7 +1384,6 @@ MenuController::MenuController(bool blocking,
internal::MenuControllerDelegate* delegate)
: blocking_run_(blocking),
showing_(false),
- running_(false),
exit_type_(EXIT_NONE),
did_capture_(false),
result_(NULL),
@@ -2689,9 +2662,6 @@ MenuItemView* MenuController::ExitMenuRun() {
showing_ = false;
did_capture_ = false;
- // TODO(jonross): remove after tracking down the cause of
- // (crbug.com/683087).
- running_ = false;
}
MenuItemView* result = result_;
« no previous file with comments | « ui/views/controls/menu/menu_controller.h ('k') | ui/views/controls/menu/menu_runner_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698