| 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 package org.chromium.mojo.shell; | 5 package org.chromium.mojo.shell; |
| 6 | 6 |
| 7 import android.util.Log; | 7 import android.util.Log; |
| 8 | 8 |
| 9 import org.chromium.base.BaseChromiumApplication; | 9 import org.chromium.base.BaseChromiumApplication; |
| 10 import org.chromium.base.PathUtils; | 10 import org.chromium.base.PathUtils; |
| 11 import org.chromium.base.library_loader.LibraryLoader; | 11 import org.chromium.base.library_loader.LibraryLoader; |
| 12 import org.chromium.base.library_loader.LibraryProcessType; |
| 12 import org.chromium.base.library_loader.ProcessInitException; | 13 import org.chromium.base.library_loader.ProcessInitException; |
| 13 | 14 |
| 14 /** | 15 /** |
| 15 * MojoShell implementation of {@link android.app.Application}, managing applica
tion-level global | 16 * MojoShell implementation of {@link android.app.Application}, managing applica
tion-level global |
| 16 * state and initializations. | 17 * state and initializations. |
| 17 */ | 18 */ |
| 18 public class MojoShellApplication extends BaseChromiumApplication { | 19 public class MojoShellApplication extends BaseChromiumApplication { |
| 19 private static final String TAG = "MojoShellApplication"; | 20 private static final String TAG = "MojoShellApplication"; |
| 20 private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "mojo_shell"; | 21 private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "mojo_shell"; |
| 21 | 22 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 40 */ | 41 */ |
| 41 private void initializeJavaUtils() { | 42 private void initializeJavaUtils() { |
| 42 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); | 43 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); |
| 43 } | 44 } |
| 44 | 45 |
| 45 /** | 46 /** |
| 46 * Loads the native library. | 47 * Loads the native library. |
| 47 */ | 48 */ |
| 48 private void initializeNative() { | 49 private void initializeNative() { |
| 49 try { | 50 try { |
| 50 LibraryLoader.ensureInitialized(); | 51 LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER).ensureInitiali
zed(); |
| 51 } catch (ProcessInitException e) { | 52 } catch (ProcessInitException e) { |
| 52 Log.e(TAG, "libmojo_shell initialization failed.", e); | 53 Log.e(TAG, "libmojo_shell initialization failed.", e); |
| 53 throw new RuntimeException(e); | 54 throw new RuntimeException(e); |
| 54 } | 55 } |
| 55 } | 56 } |
| 56 } | 57 } |
| OLD | NEW |