Java Code Examples for org.chromium.chrome.browser.ChromeApplication#getChildProcessCreationParams()

The following examples show how to use org.chromium.chrome.browser.ChromeApplication#getChildProcessCreationParams() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WebApkActivity.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Initializes {@link ChildProcessCreationParams} as a WebAPK's renderer process if
 * {@link isForWebApk}} is true; as Chrome's child process otherwise.
 * @param isForWebApk: Whether the {@link ChildProcessCreationParams} is initialized as a
 *                     WebAPK renderer process.
 */
private void initializeChildProcessCreationParams(boolean isForWebApk) {
    ChromeApplication chrome = (ChromeApplication) ContextUtils.getApplicationContext();
    ChildProcessCreationParams params = chrome.getChildProcessCreationParams();
    if (isForWebApk) {
        int extraBindFlag = params == null ? 0 : params.getExtraBindFlags();
        params = new ChildProcessCreationParams(getWebappInfo().webApkPackageName(),
                extraBindFlag, LibraryProcessType.PROCESS_CHILD);
    }
    ChildProcessCreationParams.set(params);
}
 
Example 2
Source File: WebApkActivity.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Initializes {@link ChildProcessCreationParams} as a WebAPK's renderer process if
 * {@link isForWebApk}} is true; as Chrome's child process otherwise.
 * @param isForWebApk: Whether the {@link ChildProcessCreationParams} is initialized as a
 *                     WebAPK renderer process.
 */
private void initializeChildProcessCreationParams(boolean isForWebApk) {
    // TODO(hanxi): crbug.com/664530. WebAPKs shouldn't use a global ChildProcessCreationParams.
    ChromeApplication chrome = (ChromeApplication) ContextUtils.getApplicationContext();
    ChildProcessCreationParams params = chrome.getChildProcessCreationParams();
    if (isForWebApk) {
        boolean isExternalService = false;
        params = new ChildProcessCreationParams(getWebappInfo().webApkPackageName(),
                isExternalService, LibraryProcessType.PROCESS_CHILD);
    }
    ChildProcessCreationParams.set(params);
}