| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |