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

Side by Side Diff: content/public/android/java/src/org/chromium/content/app/ContentMain.java

Issue 1407233017: Define a Java-side global application context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 package org.chromium.content.app; 5 package org.chromium.content.app;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 8
9 import org.chromium.base.ContextUtils;
9 import org.chromium.base.annotations.JNINamespace; 10 import org.chromium.base.annotations.JNINamespace;
10 11
11 /** 12 /**
12 * This class is used to initialize all types of process. It corresponds to 13 * This class is used to initialize all types of process. It corresponds to
13 * content/public/app/content_main.h which is not used in Android as it has 14 * content/public/app/content_main.h which is not used in Android as it has
14 * the different initialization process. 15 * the different initialization process.
15 * 16 *
16 * TODO(michaelbai): Refactorying the BrowserProcessMain.java and the 17 * TODO(michaelbai): Refactorying the BrowserProcessMain.java and the
17 * ChildProcessService.java to start ContentMain, and run the process 18 * ChildProcessService.java to start ContentMain, and run the process
18 * specific initialization code in ContentMainRunner::Initialize. 19 * specific initialization code in ContentMainRunner::Initialize.
19 * 20 *
20 **/ 21 **/
21 @JNINamespace("content") 22 @JNINamespace("content")
22 public class ContentMain { 23 public class ContentMain {
23 /** 24 /**
24 * Initialize application context in native side. 25 * Initialize global application context.
25 **/ 26 **/
26 public static void initApplicationContext(Context context) { 27 public static void initApplicationContext(Context context) {
27 nativeInitApplicationContext(context); 28 ContextUtils.initApplicationContext(context);
28 } 29 }
29 30
30 /** 31 /**
31 * Start the ContentMainRunner in native side. 32 * Start the ContentMainRunner in native side.
32 **/ 33 **/
33 public static int start() { 34 public static int start() {
34 return nativeStart(); 35 return nativeStart();
35 } 36 }
36 37
37 private static native void nativeInitApplicationContext(Context context);
38 private static native int nativeStart(); 38 private static native int nativeStart();
39 } 39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698