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

Side by Side Diff: base/message_pump_dispatcher.h

Issue 10479018: Add base::RunLoop and update ui_test_utils to use it to reduce flakiness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: phajdan feedback Created 8 years, 5 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 | « base/message_pump_android.cc ('k') | base/run_loop.h » ('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 #ifndef BASE_MESSAGE_PUMP_DISPATCHER_H 5 #ifndef BASE_MESSAGE_PUMP_DISPATCHER_H
6 #define BASE_MESSAGE_PUMP_DISPATCHER_H 6 #define BASE_MESSAGE_PUMP_DISPATCHER_H
7 #pragma once 7 #pragma once
8 8
9 #include "base/base_export.h" 9 #include "base/base_export.h"
10 #include "base/event_types.h" 10 #include "base/event_types.h"
11 11
12 namespace base { 12 namespace base {
13 13
14 // Dispatcher is used during a nested invocation of Run to dispatch 14 // Dispatcher is used during a nested invocation of Run to dispatch events when
15 // events when |MessageLoop::RunWithDispatcher| is invoked. If 15 // |RunLoop(dispatcher).Run()| is used. If |RunLoop().Run()| is invoked,
16 // |MessageLoop::Run| is invoked, MessageLoop does not dispatch events 16 // MessageLoop does not dispatch events (or invoke TranslateMessage), rather
17 // (or invoke TranslateMessage), rather every message is passed to 17 // every message is passed to Dispatcher's Dispatch method for dispatch. It is
18 // Dispatcher's Dispatch method for dispatch. It is up to the 18 // up to the Dispatcher whether or not to dispatch the event.
19 // Dispatcher whether or not to dispatch the event.
20 // 19 //
21 // The nested loop is exited by either posting a quit, or returning false 20 // The nested loop is exited by either posting a quit, or returning false
22 // from Dispatch. 21 // from Dispatch.
23 class BASE_EXPORT MessagePumpDispatcher { 22 class BASE_EXPORT MessagePumpDispatcher {
24 public: 23 public:
25 virtual ~MessagePumpDispatcher() {} 24 virtual ~MessagePumpDispatcher() {}
26 25
27 // Dispatches the event. If true is returned processing continues as 26 // Dispatches the event. If true is returned processing continues as
28 // normal. If false is returned, the nested loop exits immediately. 27 // normal. If false is returned, the nested loop exits immediately.
29 virtual bool Dispatch(const NativeEvent& event) = 0; 28 virtual bool Dispatch(const NativeEvent& event) = 0;
30 }; 29 };
31 30
32 } // namespace base 31 } // namespace base
33 32
34 #endif // BASE_MESSAGE_PUMP_DISPATCHER_H 33 #endif // BASE_MESSAGE_PUMP_DISPATCHER_H
OLDNEW
« no previous file with comments | « base/message_pump_android.cc ('k') | base/run_loop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698