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

Side by Side Diff: content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ChildProcessLauncherTestHelperService.java

Issue 2795913003: [Merge m58] android: Limit bindToCaller check to webview (Closed)
Patch Set: remove final from chrome 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 unified diff | Download patch
« no previous file with comments | « content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.content_shell_apk; 5 package org.chromium.content_shell_apk;
6 6
7 import android.app.Service; 7 import android.app.Service;
8 import android.content.Intent; 8 import android.content.Intent;
9 import android.os.Handler; 9 import android.os.Handler;
10 import android.os.HandlerThread; 10 import android.os.HandlerThread;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 @Override 62 @Override
63 public IBinder onBind(Intent intent) { 63 public IBinder onBind(Intent intent) {
64 Messenger messenger = 64 Messenger messenger =
65 new Messenger(new Handler(mHandlerThread.getLooper(), mHandlerCa llback)); 65 new Messenger(new Handler(mHandlerThread.getLooper(), mHandlerCa llback));
66 return messenger.getBinder(); 66 return messenger.getBinder();
67 } 67 }
68 68
69 private void doBindService(final Message msg) { 69 private void doBindService(final Message msg) {
70 String[] commandLine = { "_", "--" + BaseSwitches.RENDERER_WAIT_FOR_JAVA _DEBUGGER }; 70 String[] commandLine = { "_", "--" + BaseSwitches.RENDERER_WAIT_FOR_JAVA _DEBUGGER };
71 ChildProcessCreationParams params = new ChildProcessCreationParams(getPa ckageName(), false, 71 final boolean bindToCaller = true;
72 LibraryProcessType.PROCESS_CHILD); 72 ChildProcessCreationParams params = new ChildProcessCreationParams(
73 getPackageName(), false, LibraryProcessType.PROCESS_CHILD, bindT oCaller);
73 final ChildProcessConnection conn = ChildProcessLauncher.startForTesting (this, commandLine, 74 final ChildProcessConnection conn = ChildProcessLauncher.startForTesting (this, commandLine,
74 new FileDescriptorInfo[0], params); 75 new FileDescriptorInfo[0], params);
75 76
76 // Poll the connection until it is set up. The main test in ChildProcess LauncherTest, which 77 // Poll the connection until it is set up. The main test in ChildProcess LauncherTest, which
77 // has bound the connection to this service, manages the timeout via the lifetime of this 78 // has bound the connection to this service, manages the timeout via the lifetime of this
78 // service. 79 // service.
79 final Handler handler = new Handler(); 80 final Handler handler = new Handler();
80 final Runnable task = new Runnable() { 81 final Runnable task = new Runnable() {
81 final Messenger mReplyTo = msg.replyTo; 82 final Messenger mReplyTo = msg.replyTo;
82 83
83 @Override 84 @Override
84 public void run() { 85 public void run() {
85 if (conn.getPid() != 0) { 86 if (conn.getPid() != 0) {
86 try { 87 try {
87 mReplyTo.send(Message.obtain(null, MSG_BIND_SERVICE_REPL Y, conn.getPid(), 88 mReplyTo.send(Message.obtain(null, MSG_BIND_SERVICE_REPL Y, conn.getPid(),
88 conn.getServiceNumber())); 89 conn.getServiceNumber()));
89 } catch (RemoteException ex) { 90 } catch (RemoteException ex) {
90 throw new RuntimeException(ex); 91 throw new RuntimeException(ex);
91 } 92 }
92 } else { 93 } else {
93 handler.postDelayed(this, 10 /* milliseconds */); 94 handler.postDelayed(this, 10 /* milliseconds */);
94 } 95 }
95 } 96 }
96 }; 97 };
97 handler.postDelayed(task, 10); 98 handler.postDelayed(task, 10);
98 } 99 }
99 } 100 }
OLDNEW
« no previous file with comments | « content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698