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

Side by Side Diff: base/message_pump_android.cc

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: win_shared build Created 8 years, 6 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
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_pump_android.h" 5 #include "base/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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 MessagePumpForUI::~MessagePumpForUI() { 67 MessagePumpForUI::~MessagePumpForUI() {
68 } 68 }
69 69
70 void MessagePumpForUI::Run(Delegate* delegate) { 70 void MessagePumpForUI::Run(Delegate* delegate) {
71 NOTREACHED() << "UnitTests should rely on MessagePumpForUIStub in" 71 NOTREACHED() << "UnitTests should rely on MessagePumpForUIStub in"
72 " test_stub_android.h"; 72 " test_stub_android.h";
73 } 73 }
74 74
75 void MessagePumpForUI::Start(Delegate* delegate) { 75 void MessagePumpForUI::Start(Delegate* delegate) {
76 state_ = new MessageLoop::AutoRunState(MessageLoop::current()); 76 state_ = new MessageLoop::AutoRunState(MessageLoop::current(), NULL);
77 77
78 DCHECK(g_system_message_handler_obj.Get().is_null()); 78 DCHECK(g_system_message_handler_obj.Get().is_null());
79 79
80 JNIEnv* env = base::android::AttachCurrentThread(); 80 JNIEnv* env = base::android::AttachCurrentThread();
81 DCHECK(env); 81 DCHECK(env);
82 82
83 g_system_message_handler_obj.Get().Reset( 83 g_system_message_handler_obj.Get().Reset(
84 Java_SystemMessageHandler_create(env, reinterpret_cast<jint>(delegate))); 84 Java_SystemMessageHandler_create(env, reinterpret_cast<jint>(delegate)));
85 } 85 }
86 86
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 Java_SystemMessageHandler_setDelayedTimer(env, 125 Java_SystemMessageHandler_setDelayedTimer(env,
126 g_system_message_handler_obj.Get().obj(), millis); 126 g_system_message_handler_obj.Get().obj(), millis);
127 } 127 }
128 128
129 // Register native methods 129 // Register native methods
130 bool RegisterSystemMessageHandler(JNIEnv* env) { 130 bool RegisterSystemMessageHandler(JNIEnv* env) {
131 return RegisterNativesImpl(env); 131 return RegisterNativesImpl(env);
132 } 132 }
133 133
134 } // namespace base 134 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698