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

Side by Side Diff: message_loop/message_pump_android.cc

Issue 2050803003: Update to Chromium //base at Chromium commit e3a753f17bac62738b0dbf0b36510f767b081e4b. (Closed) Base URL: https://github.com/domokit/base.git@master
Patch Set: Created 4 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
« no previous file with comments | « memory/shared_memory_handle_mac.cc ('k') | pickle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "base/lazy_instance.h" 11 #include "base/lazy_instance.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/run_loop.h" 13 #include "base/run_loop.h"
14 #include "base/time/time.h" 14 #include "base/time/time.h"
15 #include "jni/SystemMessageHandler_jni.h" 15 #include "jni/SystemMessageHandler_jni.h"
16 16
17 using base::android::ScopedJavaLocalRef; 17 using base::android::ScopedJavaLocalRef;
18 18
19 // ---------------------------------------------------------------------------- 19 // ----------------------------------------------------------------------------
20 // Native JNI methods called by Java. 20 // Native JNI methods called by Java.
21 // ---------------------------------------------------------------------------- 21 // ----------------------------------------------------------------------------
22 // This method can not move to anonymous namespace as it has been declared as 22 // This method can not move to anonymous namespace as it has been declared as
23 // 'static' in system_message_handler_jni.h. 23 // 'static' in system_message_handler_jni.h.
24 static void DoRunLoopOnce(JNIEnv* env, jobject obj, jlong native_delegate, 24 static void DoRunLoopOnce(JNIEnv* env,
25 jlong delayed_scheduled_time_ticks) { 25 const JavaParamRef<jobject>& obj,
26 jlong native_delegate,
27 jlong delayed_scheduled_time_ticks) {
26 base::MessagePump::Delegate* delegate = 28 base::MessagePump::Delegate* delegate =
27 reinterpret_cast<base::MessagePump::Delegate*>(native_delegate); 29 reinterpret_cast<base::MessagePump::Delegate*>(native_delegate);
28 DCHECK(delegate); 30 DCHECK(delegate);
29 // This is based on MessagePumpForUI::DoRunLoop() from desktop. 31 // This is based on MessagePumpForUI::DoRunLoop() from desktop.
30 // Note however that our system queue is handled in the java side. 32 // Note however that our system queue is handled in the java side.
31 // In desktop we inspect and process a single system message and then 33 // In desktop we inspect and process a single system message and then
32 // we call DoWork() / DoDelayedWork(). 34 // we call DoWork() / DoDelayedWork().
33 // On Android, the java message queue may contain messages for other handlers 35 // On Android, the java message queue may contain messages for other handlers
34 // that will be processed before calling here again. 36 // that will be processed before calling here again.
35 bool did_work = delegate->DoWork(); 37 bool did_work = delegate->DoWork();
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 system_message_handler_obj_.obj(), 155 system_message_handler_obj_.obj(),
154 delayed_work_time.ToInternalValue(), millis); 156 delayed_work_time.ToInternalValue(), millis);
155 } 157 }
156 158
157 // static 159 // static
158 bool MessagePumpForUI::RegisterBindings(JNIEnv* env) { 160 bool MessagePumpForUI::RegisterBindings(JNIEnv* env) {
159 return RegisterNativesImpl(env); 161 return RegisterNativesImpl(env);
160 } 162 }
161 163
162 } // namespace base 164 } // namespace base
OLDNEW
« no previous file with comments | « memory/shared_memory_handle_mac.cc ('k') | pickle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698