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

Side by Side Diff: base/run_loop.cc

Issue 1891233006: mus: Fix handled status in UI event ack, add MessageLoop::NestingObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@eventresult
Patch Set: review comments 3 Created 4 years, 7 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
« no previous file with comments | « base/message_loop/message_loop_test.cc ('k') | ui/views/mus/BUILD.gn » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/run_loop.h" 5 #include "base/run_loop.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/tracked_objects.h" 8 #include "base/tracked_objects.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 // Allow Quit to be called before Run. 62 // Allow Quit to be called before Run.
63 if (quit_called_) 63 if (quit_called_)
64 return false; 64 return false;
65 65
66 // Push RunLoop stack: 66 // Push RunLoop stack:
67 previous_run_loop_ = loop_->run_loop_; 67 previous_run_loop_ = loop_->run_loop_;
68 run_depth_ = previous_run_loop_? previous_run_loop_->run_depth_ + 1 : 1; 68 run_depth_ = previous_run_loop_? previous_run_loop_->run_depth_ + 1 : 1;
69 loop_->run_loop_ = this; 69 loop_->run_loop_ = this;
70 70
71 if (run_depth_ > 1)
72 loop_->NotifyBeginNestedLoop();
73
71 running_ = true; 74 running_ = true;
72 return true; 75 return true;
73 } 76 }
74 77
75 void RunLoop::AfterRun() { 78 void RunLoop::AfterRun() {
76 running_ = false; 79 running_ = false;
77 80
78 // Pop RunLoop stack: 81 // Pop RunLoop stack:
79 loop_->run_loop_ = previous_run_loop_; 82 loop_->run_loop_ = previous_run_loop_;
80 83
81 // Execute deferred QuitNow, if any: 84 // Execute deferred QuitNow, if any:
82 if (previous_run_loop_ && previous_run_loop_->quit_called_) 85 if (previous_run_loop_ && previous_run_loop_->quit_called_)
83 loop_->QuitNow(); 86 loop_->QuitNow();
84 } 87 }
85 88
86 } // namespace base 89 } // namespace base
OLDNEW
« no previous file with comments | « base/message_loop/message_loop_test.cc ('k') | ui/views/mus/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698