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

Side by Side Diff: shell/android/main.cc

Issue 1105773002: Teach the mojo_shell --trace-startup flag to gather data from services (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: buffer data from tracing service to avoid needing to frame it or add extra commas Created 5 years, 7 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
OLDNEW
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 "shell/android/main.h" 5 #include "shell/android/main.h"
6 6
7 #include "base/android/fifo_utils.h" 7 #include "base/android/fifo_utils.h"
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/android/jni_array.h" 9 #include "base/android/jni_array.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 env, mojo_shell_child_path)), 214 env, mojo_shell_child_path)),
215 parameters)); 215 parameters));
216 216
217 InitializeLogging(); 217 InitializeLogging();
218 218
219 InitializeRedirection(); 219 InitializeRedirection();
220 220
221 // We want ~MessageLoop to happen prior to ~Context. Initializing 221 // We want ~MessageLoop to happen prior to ~Context. Initializing
222 // LazyInstances is akin to stack-allocating objects; their destructors 222 // LazyInstances is akin to stack-allocating objects; their destructors
223 // will be invoked first-in-last-out. 223 // will be invoked first-in-last-out.
224 Context* shell_context = new Context(); 224 Context* shell_context = new Context(tracer);
225 shell_context->SetShellFileRoot(base::FilePath( 225 shell_context->SetShellFileRoot(base::FilePath(
226 base::android::ConvertJavaStringToUTF8(env, j_local_apps_directory))); 226 base::android::ConvertJavaStringToUTF8(env, j_local_apps_directory)));
227 g_internal_data.Get().context.reset(shell_context); 227 g_internal_data.Get().context.reset(shell_context);
228 228
229 g_internal_data.Get().java_message_loop.reset(new base::MessageLoopForUI); 229 g_internal_data.Get().java_message_loop.reset(new base::MessageLoopForUI);
230 base::MessageLoopForUI::current()->Start(); 230 base::MessageLoopForUI::current()->Start();
231 231
232 if (trace_startup) { 232 if (trace_startup) {
233 g_internal_data.Get().java_message_loop->PostDelayedTask( 233 g_internal_data.Get().java_message_loop->PostDelayedTask(
234 FROM_HERE, 234 FROM_HERE,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 std::string url = base::android::ConvertJavaStringToUTF8(env, jurl); 270 std::string url = base::android::ConvertJavaStringToUTF8(env, jurl);
271 g_internal_data.Get().shell_task_runner->PostTask( 271 g_internal_data.Get().shell_task_runner->PostTask(
272 FROM_HERE, base::Bind(&EmbedApplicationByURL, context, url)); 272 FROM_HERE, base::Bind(&EmbedApplicationByURL, context, url));
273 } 273 }
274 274
275 bool RegisterShellMain(JNIEnv* env) { 275 bool RegisterShellMain(JNIEnv* env) {
276 return RegisterNativesImpl(env); 276 return RegisterNativesImpl(env);
277 } 277 }
278 278
279 } // namespace shell 279 } // namespace shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698