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

Side by Side Diff: content/public/test/nested_message_pump_android.h

Issue 733533002: Do not start RunLoop of MessagePumpForUI in NestedMessagePumpAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix failure of FrameTreeBrowserTest.FrameTreeAfterCrash Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CONTENT_PUBLIC_TEST_NESTED_MESSAGE_PUMP_ANDROID_ 5 #ifndef CONTENT_PUBLIC_TEST_NESTED_MESSAGE_PUMP_ANDROID_
6 #define CONTENT_PUBLIC_TEST_NESTED_MESSAGE_PUMP_ANDROID_ 6 #define CONTENT_PUBLIC_TEST_NESTED_MESSAGE_PUMP_ANDROID_
7 7
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/message_loop/message_pump_android.h" 10 #include "base/message_loop/message_pump_android.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 // A nested message pump to be used for content browsertests and layout tests 14 // A nested message pump to be used for content browsertests and layout tests
15 // on Android. It overrides the default UI message pump to allow nested loops. 15 // on Android. It overrides the default UI message pump to allow nested loops.
16 class NestedMessagePumpAndroid : public base::MessagePumpForUI { 16 class NestedMessagePumpAndroid : public base::MessagePumpForUI {
17 public: 17 public:
18 NestedMessagePumpAndroid(); 18 NestedMessagePumpAndroid();
19 19
20 virtual void Run(Delegate* delegate) override; 20 virtual void Run(Delegate* delegate) override;
21 virtual void Quit() override; 21 virtual void Quit() override;
22 virtual void ScheduleWork() override; 22 virtual void ScheduleWork() override;
23 virtual void ScheduleDelayedWork( 23 virtual void ScheduleDelayedWork(
24 const base::TimeTicks& delayed_work_time) override; 24 const base::TimeTicks& delayed_work_time) override;
25 virtual void Start(Delegate* delegate) override; 25 virtual void Start(Delegate* delegate) override;
26 virtual bool IsRedundantQuitExpected() override;
26 27
27 static bool RegisterJni(JNIEnv* env); 28 static bool RegisterJni(JNIEnv* env);
28 29
29 protected: 30 protected:
30 virtual ~NestedMessagePumpAndroid(); 31 virtual ~NestedMessagePumpAndroid();
31 32
32 private: 33 private:
33 // We may make recursive calls to Run, so we save state that needs to be 34 // We may make recursive calls to Run, so we save state that needs to be
34 // separate between them in this structure type. 35 // separate between them in this structure type.
35 struct RunState; 36 struct RunState;
36 37
37 RunState* state_; 38 RunState* state_;
39 bool redundant_quit_executed_;
38 40
39 DISALLOW_COPY_AND_ASSIGN(NestedMessagePumpAndroid); 41 DISALLOW_COPY_AND_ASSIGN(NestedMessagePumpAndroid);
40 }; 42 };
41 43
42 } // namespace content 44 } // namespace content
43 45
44 #endif // CONTENT_PUBLIC_TEST_NESTED_MESSAGE_PUMP_ANDROID_ 46 #endif // CONTENT_PUBLIC_TEST_NESTED_MESSAGE_PUMP_ANDROID_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698