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

Unified Diff: content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.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
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 7a8f92c04e3c28a529dd049f4bfbeb67e420d1a3..e74e97f00e19285c5acc92d0db208924c1010b2f 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,7 +32,6 @@
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;
@@ -127,20 +126,23 @@
}
@Override
- public void setupConnection(Bundle args, ICallbackInt pidCallback, IBinder gpuCallback)
- throws RemoteException {
+ public int setupConnection(Bundle args, IBinder callback) {
+ int callingPid = Binder.getCallingPid();
synchronized (mBinderLock) {
- if (mBindToCallerCheck && mBoundCallingPid == 0) {
- Log.e(TAG, "Service has not been bound with bindToCaller()");
- pidCallback.call(-1);
- return;
+ 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;
}
}
- pidCallback.call(Process.myPid());
- mGpuCallback =
- gpuCallback != null ? IGpuProcessCallback.Stub.asInterface(gpuCallback) : null;
+ mGpuCallback = callback != null ? IGpuProcessCallback.Stub.asInterface(callback) : null;
getServiceInfo(args);
+ return Process.myPid();
}
@Override

Powered by Google App Engine
This is Rietveld 408576698