| 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_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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 namespace base { | 84 namespace base { |
| 85 | 85 |
| 86 MessagePumpForUI::MessagePumpForUI() | 86 MessagePumpForUI::MessagePumpForUI() |
| 87 : run_loop_(NULL) { | 87 : run_loop_(NULL) { |
| 88 } | 88 } |
| 89 | 89 |
| 90 MessagePumpForUI::~MessagePumpForUI() { | 90 MessagePumpForUI::~MessagePumpForUI() { |
| 91 } | 91 } |
| 92 | 92 |
| 93 void MessagePumpForUI::Run(Delegate* delegate) { | 93 void MessagePumpForUI::Run(Delegate* delegate) { |
| 94 #if !defined(USE_AURA) |
| 94 NOTREACHED() << "UnitTests should rely on MessagePumpForUIStub in" | 95 NOTREACHED() << "UnitTests should rely on MessagePumpForUIStub in" |
| 95 " test_stub_android.h"; | 96 " test_stub_android.h"; |
| 97 #else |
| 98 LOG(ERROR) << "auraclank: MessagePumpForUI::Run:" |
| 99 << "can't run nested message loop."; |
| 100 #endif |
| 96 } | 101 } |
| 97 | 102 |
| 98 void MessagePumpForUI::Start(Delegate* delegate) { | 103 void MessagePumpForUI::Start(Delegate* delegate) { |
| 99 run_loop_ = new RunLoop(); | 104 run_loop_ = new RunLoop(); |
| 100 // Since the RunLoop was just created above, BeforeRun should be guaranteed to | 105 // Since the RunLoop was just created above, BeforeRun should be guaranteed to |
| 101 // return true (it only returns false if the RunLoop has been Quit already). | 106 // return true (it only returns false if the RunLoop has been Quit already). |
| 102 if (!run_loop_->BeforeRun()) | 107 if (!run_loop_->BeforeRun()) |
| 103 NOTREACHED(); | 108 NOTREACHED(); |
| 104 | 109 |
| 105 DCHECK(system_message_handler_obj_.is_null()); | 110 DCHECK(system_message_handler_obj_.is_null()); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 system_message_handler_obj_.obj(), | 158 system_message_handler_obj_.obj(), |
| 154 delayed_work_time.ToInternalValue(), millis); | 159 delayed_work_time.ToInternalValue(), millis); |
| 155 } | 160 } |
| 156 | 161 |
| 157 // static | 162 // static |
| 158 bool MessagePumpForUI::RegisterBindings(JNIEnv* env) { | 163 bool MessagePumpForUI::RegisterBindings(JNIEnv* env) { |
| 159 return RegisterNativesImpl(env); | 164 return RegisterNativesImpl(env); |
| 160 } | 165 } |
| 161 | 166 |
| 162 } // namespace base | 167 } // namespace base |
| OLD | NEW |