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

Side by Side Diff: base/message_loop/message_pump_android.cc

Issue 18181011: Make a fairer combined message loop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated to ask the pump if it needs to be notified for each work item added Created 7 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
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/message_loop/message_pump_android.h" 5 #include "base/message_loop/message_pump_android.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 namespace base { 56 namespace base {
57 57
58 MessagePumpForUI::MessagePumpForUI() 58 MessagePumpForUI::MessagePumpForUI()
59 : run_loop_(NULL) { 59 : run_loop_(NULL) {
60 } 60 }
61 61
62 MessagePumpForUI::~MessagePumpForUI() { 62 MessagePumpForUI::~MessagePumpForUI() {
63 } 63 }
64 64
65 bool MessagePumpForUI::NeedsScheduleWorkPerTask() {
66 return true;
67 }
68
65 void MessagePumpForUI::Run(Delegate* delegate) { 69 void MessagePumpForUI::Run(Delegate* delegate) {
66 NOTREACHED() << "UnitTests should rely on MessagePumpForUIStub in" 70 NOTREACHED() << "UnitTests should rely on MessagePumpForUIStub in"
67 " test_stub_android.h"; 71 " test_stub_android.h";
68 } 72 }
69 73
70 void MessagePumpForUI::Start(Delegate* delegate) { 74 void MessagePumpForUI::Start(Delegate* delegate) {
71 run_loop_ = new RunLoop(); 75 run_loop_ = new RunLoop();
72 // Since the RunLoop was just created above, BeforeRun should be guaranteed to 76 // Since the RunLoop was just created above, BeforeRun should be guaranteed to
73 // return true (it only returns false if the RunLoop has been Quit already). 77 // return true (it only returns false if the RunLoop has been Quit already).
74 if (!run_loop_->BeforeRun()) 78 if (!run_loop_->BeforeRun())
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 Java_SystemMessageHandler_setDelayedTimer(env, 127 Java_SystemMessageHandler_setDelayedTimer(env,
124 system_message_handler_obj_.obj(), millis); 128 system_message_handler_obj_.obj(), millis);
125 } 129 }
126 130
127 // static 131 // static
128 bool MessagePumpForUI::RegisterBindings(JNIEnv* env) { 132 bool MessagePumpForUI::RegisterBindings(JNIEnv* env) {
129 return RegisterNativesImpl(env); 133 return RegisterNativesImpl(env);
130 } 134 }
131 135
132 } // namespace base 136 } // namespace base
OLDNEW
« base/message_loop/message_pump_android.h ('K') | « base/message_loop/message_pump_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698