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

Side by Side Diff: content/public/android/java/src/org/chromium/content/browser/ChildProcessConnection.java

Issue 2760093002: Making callbacks in Android ChildProcessLauncher generic. (Closed)
Patch Set: Renaming callbacks class to GpuProcessCallback. Created 3 years, 9 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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.browser; 5 package org.chromium.content.browser;
6 6
7 import android.os.Bundle; 7 import android.os.Bundle;
8 import android.os.IBinder;
8 9
9 import org.chromium.base.process_launcher.ChildProcessCreationParams; 10 import org.chromium.base.process_launcher.ChildProcessCreationParams;
10 import org.chromium.content.common.FileDescriptorInfo; 11 import org.chromium.content.common.FileDescriptorInfo;
11 import org.chromium.content.common.IChildProcessCallback;
12 import org.chromium.content.common.IChildProcessService; 12 import org.chromium.content.common.IChildProcessService;
13 13
14 import javax.annotation.Nullable;
15
14 /** 16 /**
15 * Manages a connection between the browser activity and a child service. ChildP rocessConnection is 17 * Manages a connection between the browser activity and a child service. ChildP rocessConnection is
16 * responsible for estabilishing the connection (start()), closing it (stop()) a nd manipulating the 18 * responsible for estabilishing the connection (start()), closing it (stop()) a nd manipulating the
17 * bindings held onto the service (addStrongBinding(), removeStrongBinding(), 19 * bindings held onto the service (addStrongBinding(), removeStrongBinding(),
18 * removeInitialBinding()). 20 * removeInitialBinding()).
19 */ 21 */
20 public interface ChildProcessConnection { 22 public interface ChildProcessConnection {
21 /** 23 /**
22 * Used to notify the consumer about disconnection of the service. This call back is provided 24 * Used to notify the consumer about disconnection of the service. This call back is provided
23 * earlier than ConnectionCallbacks below, as a child process might die befo re the connection is 25 * earlier than ConnectionCallbacks below, as a child process might die befo re the connection is
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 * separate to allow to pass whatever parameters are available in start(), a nd complete the 79 * separate to allow to pass whatever parameters are available in start(), a nd complete the
78 * remainder later while reducing the connection setup latency. 80 * remainder later while reducing the connection setup latency.
79 * @param startCallback (optional) callback when the child process starts or fails to start. 81 * @param startCallback (optional) callback when the child process starts or fails to start.
80 */ 82 */
81 void start(StartCallback startCallback); 83 void start(StartCallback startCallback);
82 84
83 /** 85 /**
84 * Setups the connection after it was started with start(). 86 * Setups the connection after it was started with start().
85 * @param commandLine (optional) will be ignored if the command line was alr eady sent in start() 87 * @param commandLine (optional) will be ignored if the command line was alr eady sent in start()
86 * @param filesToBeMapped a list of file descriptors that should be register ed 88 * @param filesToBeMapped a list of file descriptors that should be register ed
87 * @param processCallback used for status updates regarding this process con nection 89 * @param callback optional client specified callbacks that the child can us e to communicate
90 * with the parent process
88 * @param connectionCallback will be called exactly once after the connectio n is set up or the 91 * @param connectionCallback will be called exactly once after the connectio n is set up or the
89 * setup fails 92 * setup fails
90 */ 93 */
91 void setupConnection( 94 void setupConnection(String[] commandLine, FileDescriptorInfo[] filesToBeMap ped,
92 String[] commandLine, 95 @Nullable IBinder callback, ConnectionCallback connectionCallback, B undle sharedRelros);
93 FileDescriptorInfo[] filesToBeMapped,
94 IChildProcessCallback processCallback,
95 ConnectionCallback connectionCallback,
96 Bundle sharedRelros);
97 96
98 /** 97 /**
99 * Terminates the connection to IChildProcessService, closing all bindings. It is safe to call 98 * Terminates the connection to IChildProcessService, closing all bindings. It is safe to call
100 * this multiple times. 99 * this multiple times.
101 */ 100 */
102 void stop(); 101 void stop();
103 102
104 /** @return true iff the initial oom binding is currently bound. */ 103 /** @return true iff the initial oom binding is currently bound. */
105 boolean isInitialBindingBound(); 104 boolean isInitialBindingBound();
106 105
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 void addModerateBinding(); 145 void addModerateBinding();
147 146
148 /** 147 /**
149 * Called when the service is no longer in moderate use of the consumer. 148 * Called when the service is no longer in moderate use of the consumer.
150 */ 149 */
151 void removeModerateBinding(); 150 void removeModerateBinding();
152 151
153 /** @return true iff the moderate oom binding is currently bound. */ 152 /** @return true iff the moderate oom binding is currently bound. */
154 boolean isModerateBindingBound(); 153 boolean isModerateBindingBound();
155 } 154 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698