Commit f07dcdce authored by torne's avatar torne Committed by Commit bot

Remove ContentMain.initApplicationContext.

Just have callers call ContextUtils.initApplicationContext instead, the
extra indirection isn't useful.

BUG=552419
R=yfriedman@chromium.org

Review URL: https://codereview.chromium.org/1471273002

Cr-Commit-Position: refs/heads/master@{#361384}
parent 99fbcf80
...@@ -39,6 +39,7 @@ import org.chromium.android_webview.AwResource; ...@@ -39,6 +39,7 @@ import org.chromium.android_webview.AwResource;
import org.chromium.android_webview.AwSettings; import org.chromium.android_webview.AwSettings;
import org.chromium.android_webview.R; import org.chromium.android_webview.R;
import org.chromium.base.CommandLine; import org.chromium.base.CommandLine;
import org.chromium.base.ContextUtils;
import org.chromium.base.MemoryPressureListener; import org.chromium.base.MemoryPressureListener;
import org.chromium.base.PathService; import org.chromium.base.PathService;
import org.chromium.base.PathUtils; import org.chromium.base.PathUtils;
...@@ -48,7 +49,6 @@ import org.chromium.base.annotations.SuppressFBWarnings; ...@@ -48,7 +49,6 @@ import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.base.library_loader.LibraryLoader; import org.chromium.base.library_loader.LibraryLoader;
import org.chromium.base.library_loader.LibraryProcessType; import org.chromium.base.library_loader.LibraryProcessType;
import org.chromium.base.library_loader.ProcessInitException; import org.chromium.base.library_loader.ProcessInitException;
import org.chromium.content.app.ContentMain;
import org.chromium.content.browser.ContentViewStatics; import org.chromium.content.browser.ContentViewStatics;
import org.chromium.ui.base.ResourceBundle; import org.chromium.ui.base.ResourceBundle;
...@@ -423,7 +423,7 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider { ...@@ -423,7 +423,7 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider {
// will bring up just the parts it needs to make this work on a temporary // will bring up just the parts it needs to make this work on a temporary
// basis until Chromium is started for real. The temporary cookie manager // basis until Chromium is started for real. The temporary cookie manager
// needs the application context to have been set. // needs the application context to have been set.
ContentMain.initApplicationContext(getWrappedCurrentApplicationContext()); ContextUtils.initApplicationContext(getWrappedCurrentApplicationContext());
} }
mCookieManager = new CookieManagerAdapter(new AwCookieManager()); mCookieManager = new CookieManagerAdapter(new AwCookieManager());
} }
......
...@@ -14,8 +14,8 @@ import org.chromium.android_webview.AwCookieManager; ...@@ -14,8 +14,8 @@ import org.chromium.android_webview.AwCookieManager;
import org.chromium.android_webview.AwWebResourceResponse; import org.chromium.android_webview.AwWebResourceResponse;
import org.chromium.android_webview.test.util.CommonResources; import org.chromium.android_webview.test.util.CommonResources;
import org.chromium.android_webview.test.util.CookieUtils; import org.chromium.android_webview.test.util.CookieUtils;
import org.chromium.base.ContextUtils;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.content.app.ContentMain;
import org.chromium.net.test.util.TestWebServer; import org.chromium.net.test.util.TestWebServer;
...@@ -30,7 +30,7 @@ public class CookieManagerStartupTest extends AwTestBase { ...@@ -30,7 +30,7 @@ public class CookieManagerStartupTest extends AwTestBase {
@Override @Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp(); super.setUp();
ContentMain.initApplicationContext(getActivity().getApplicationContext()); ContextUtils.initApplicationContext(getActivity().getApplicationContext());
} }
@Override @Override
......
...@@ -17,6 +17,7 @@ import android.view.Surface; ...@@ -17,6 +17,7 @@ import android.view.Surface;
import org.chromium.base.BaseSwitches; import org.chromium.base.BaseSwitches;
import org.chromium.base.CommandLine; import org.chromium.base.CommandLine;
import org.chromium.base.ContextUtils;
import org.chromium.base.Log; import org.chromium.base.Log;
import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace; import org.chromium.base.annotations.JNINamespace;
...@@ -211,7 +212,7 @@ public class ChildProcessService extends Service { ...@@ -211,7 +212,7 @@ public class ChildProcessService extends Service {
mMainThread.wait(); mMainThread.wait();
} }
} }
ContentMain.initApplicationContext(sContext.get().getApplicationContext()); ContextUtils.initApplicationContext(sContext.get().getApplicationContext());
for (FileDescriptorInfo fdInfo : mFdInfos) { for (FileDescriptorInfo fdInfo : mFdInfos) {
nativeRegisterGlobalFileDescriptor( nativeRegisterGlobalFileDescriptor(
fdInfo.mId, fdInfo.mFd.detachFd(), fdInfo.mOffset, fdInfo.mSize); fdInfo.mId, fdInfo.mFd.detachFd(), fdInfo.mOffset, fdInfo.mSize);
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
package org.chromium.content.app; package org.chromium.content.app;
import android.content.Context;
import org.chromium.base.ContextUtils;
import org.chromium.base.annotations.JNINamespace; import org.chromium.base.annotations.JNINamespace;
/** /**
...@@ -21,13 +18,6 @@ import org.chromium.base.annotations.JNINamespace; ...@@ -21,13 +18,6 @@ import org.chromium.base.annotations.JNINamespace;
**/ **/
@JNINamespace("content") @JNINamespace("content")
public class ContentMain { public class ContentMain {
/**
* Initialize global application context.
**/
public static void initApplicationContext(Context context) {
ContextUtils.initApplicationContext(context);
}
/** /**
* Start the ContentMainRunner in native side. * Start the ContentMainRunner in native side.
**/ **/
......
...@@ -7,6 +7,7 @@ package org.chromium.content.browser; ...@@ -7,6 +7,7 @@ package org.chromium.content.browser;
import android.content.Context; import android.content.Context;
import android.os.Handler; import android.os.Handler;
import org.chromium.base.ContextUtils;
import org.chromium.base.Log; import org.chromium.base.Log;
import org.chromium.base.ResourceExtractor; import org.chromium.base.ResourceExtractor;
import org.chromium.base.ThreadUtils; import org.chromium.base.ThreadUtils;
...@@ -291,7 +292,7 @@ public class BrowserStartupController { ...@@ -291,7 +292,7 @@ public class BrowserStartupController {
// TODO(yfriedman): Remove dependency on a command line flag for this. // TODO(yfriedman): Remove dependency on a command line flag for this.
DeviceUtils.addDeviceSpecificUserAgentSwitch(mContext); DeviceUtils.addDeviceSpecificUserAgentSwitch(mContext);
ContentMain.initApplicationContext(mContext); ContextUtils.initApplicationContext(mContext);
nativeSetCommandLineFlags( nativeSetCommandLineFlags(
singleProcess, nativeIsPluginEnabled() ? getPlugins() : null); singleProcess, nativeIsPluginEnabled() ? getPlugins() : null);
mPostResourceExtractionTasksCompleted = true; mPostResourceExtractionTasksCompleted = true;
...@@ -319,7 +320,7 @@ public class BrowserStartupController { ...@@ -319,7 +320,7 @@ public class BrowserStartupController {
resourceExtractor.startExtractingResources(); resourceExtractor.startExtractingResources();
resourceExtractor.waitForCompletion(); resourceExtractor.waitForCompletion();
ContentMain.initApplicationContext(mContext.getApplicationContext()); ContextUtils.initApplicationContext(mContext.getApplicationContext());
nativeSetCommandLineFlags(false, null); nativeSetCommandLineFlags(false, null);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment