| OLD | NEW |
| 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 #include "content/public/test/nested_message_pump_android.h" | 5 #include "content/public/test/nested_message_pump_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
| 12 #include "base/threading/thread_restrictions.h" | 12 #include "base/threading/thread_restrictions.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "jni/NestedSystemMessageHandler_jni.h" | 14 #include "jni/NestedSystemMessageHandler_jni.h" |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 base::LazyInstance<base::android::ScopedJavaGlobalRef<jobject> > | 18 base::LazyInstance<base::android::ScopedJavaGlobalRef<jobject>>:: |
| 19 g_message_handler_obj = LAZY_INSTANCE_INITIALIZER; | 19 DestructorAtExit g_message_handler_obj = LAZY_INSTANCE_INITIALIZER; |
| 20 | 20 |
| 21 } // namespace | 21 } // namespace |
| 22 | 22 |
| 23 | 23 |
| 24 namespace content { | 24 namespace content { |
| 25 | 25 |
| 26 struct NestedMessagePumpAndroid::RunState { | 26 struct NestedMessagePumpAndroid::RunState { |
| 27 RunState(base::MessagePump::Delegate* delegate, int run_depth) | 27 RunState(base::MessagePump::Delegate* delegate, int run_depth) |
| 28 : delegate(delegate), | 28 : delegate(delegate), |
| 29 run_depth(run_depth), | 29 run_depth(run_depth), |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 if (state_) { | 145 if (state_) { |
| 146 // We know that we can't be blocked on Wait right now since this method can | 146 // We know that we can't be blocked on Wait right now since this method can |
| 147 // only be called on the same thread as Run, so we only need to update our | 147 // only be called on the same thread as Run, so we only need to update our |
| 148 // record of how long to sleep when we do sleep. | 148 // record of how long to sleep when we do sleep. |
| 149 state_->delayed_work_time = delayed_work_time; | 149 state_->delayed_work_time = delayed_work_time; |
| 150 return; | 150 return; |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace content | 154 } // namespace content |
| OLD | NEW |