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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java

Issue 2806343003: Revert of android: Async setupConnection binder call (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java
index de8e0f3457a3c253d069bff721b4721bba40b9df..2ad7b8aeb369b0d06f63816d03cd423df204ecc1 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java
@@ -21,7 +21,6 @@
import org.chromium.base.VisibleForTesting;
import org.chromium.base.process_launcher.ChildProcessCreationParams;
import org.chromium.base.process_launcher.FileDescriptorInfo;
-import org.chromium.base.process_launcher.ICallbackInt;
import org.chromium.base.process_launcher.IChildProcessService;
import java.io.IOException;
@@ -390,18 +389,6 @@
}
}
- private void onSetupConnectionResult(int pid) {
- synchronized (mLock) {
- mPid = pid;
- assert mPid != 0 : "Child service claims to be run by a process of pid=0.";
-
- if (mConnectionCallback != null) {
- mConnectionCallback.onConnected(mPid);
- }
- mConnectionCallback = null;
- }
- }
-
/**
* Called after the connection parameters have been set (in setupConnection()) *and* a
* connection has been established (as signaled by onServiceConnected()). These two events can
@@ -415,20 +402,10 @@
Bundle bundle = ChildProcessLauncher.createsServiceBundle(
mConnectionParams.mCommandLine, mConnectionParams.mFilesToBeMapped);
- ICallbackInt pidCallback = new ICallbackInt.Stub() {
- @Override
- public void call(final int pid) {
- LauncherThread.post(new Runnable() {
- @Override
- public void run() {
- onSetupConnectionResult(pid);
- }
- });
- }
- };
try {
- mService.setupConnection(bundle, pidCallback, mConnectionParams.mCallback);
- } catch (RemoteException re) {
+ mPid = mService.setupConnection(bundle, mConnectionParams.mCallback);
+ assert mPid != 0 : "Child service claims to be run by a process of pid=0.";
+ } catch (android.os.RemoteException re) {
Log.e(TAG, "Failed to setup connection.", re);
}
// We proactively close the FDs rather than wait for GC & finalizer.
@@ -440,6 +417,11 @@
Log.w(TAG, "Failed to close FD.", ioe);
}
mConnectionParams = null;
+
+ if (mConnectionCallback != null) {
+ mConnectionCallback.onConnected(mPid);
+ }
+ mConnectionCallback = null;
} finally {
TraceEvent.end("ChildProcessConnectionImpl.doConnectionSetupLocked");
}
« no previous file with comments | « content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698