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

Unified Diff: content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java

Issue 2810433002: android: Async setupConnection binder call (Closed)
Patch Set: deflake test 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
Index: content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java
diff --git a/content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java b/content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java
index e74e97f00e19285c5acc92d0db208924c1010b2f..7a8f92c04e3c28a529dd049f4bfbeb67e420d1a3 100644
--- a/content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java
+++ b/content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java
@@ -32,6 +32,7 @@ import org.chromium.base.library_loader.Linker;
import org.chromium.base.library_loader.ProcessInitException;
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 org.chromium.content.browser.ChildProcessConstants;
import org.chromium.content.common.ContentSwitches;
@@ -126,23 +127,20 @@ public class ChildProcessServiceImpl {
}
@Override
- public int setupConnection(Bundle args, IBinder callback) {
- int callingPid = Binder.getCallingPid();
+ public void setupConnection(Bundle args, ICallbackInt pidCallback, IBinder gpuCallback)
+ throws RemoteException {
synchronized (mBinderLock) {
- if (mBindToCallerCheck && mBoundCallingPid != callingPid) {
- if (mBoundCallingPid == 0) {
- Log.e(TAG, "Service has not been bound with bindToCaller()");
- } else {
- Log.e(TAG, "Client pid %d does not match the bound pid %d", callingPid,
- mBoundCallingPid);
- }
- return -1;
+ if (mBindToCallerCheck && mBoundCallingPid == 0) {
+ Log.e(TAG, "Service has not been bound with bindToCaller()");
+ pidCallback.call(-1);
+ return;
}
}
- mGpuCallback = callback != null ? IGpuProcessCallback.Stub.asInterface(callback) : null;
+ pidCallback.call(Process.myPid());
+ mGpuCallback =
+ gpuCallback != null ? IGpuProcessCallback.Stub.asInterface(gpuCallback) : null;
getServiceInfo(args);
- return Process.myPid();
}
@Override

Powered by Google App Engine
This is Rietveld 408576698