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

Side by Side Diff: components/cronet/android/api/src/org/chromium/net/BidirectionalStream.java

Issue 2106453002: [Cronet] Remove unused ping and windowUpdate methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | components/cronet/android/java/src/org/chromium/net/CronetBidirectionalStream.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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.net; 5 package org.chromium.net;
6 6
7 import android.annotation.SuppressLint; 7 import android.annotation.SuppressLint;
8 import android.support.annotation.IntDef; 8 import android.support.annotation.IntDef;
9 9
10 import java.lang.annotation.Retention; 10 import java.lang.annotation.Retention;
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 * Default implementation takes no action. 315 * Default implementation takes no action.
316 * 316 *
317 * @param stream the stream that was canceled 317 * @param stream the stream that was canceled
318 * @param info the response information. May be {@code null} if no respo nse was 318 * @param info the response information. May be {@code null} if no respo nse was
319 * received. 319 * received.
320 */ 320 */
321 public void onCanceled(BidirectionalStream stream, UrlResponseInfo info) {} 321 public void onCanceled(BidirectionalStream stream, UrlResponseInfo info) {}
322 } 322 }
323 323
324 /** 324 /**
325 * A callback that is invoked when the acknowledgement to a {@link #ping pin g()} is received.
326 * Exactly one of the two methods will be invoked per each call to {@link #p ing ping()}.
327 */
328 public abstract static class PingCallback {
329 /**
330 * Invoked when a ping is acknowledged. The given argument is the round- trip time of the
331 * ping, in microseconds.
332 *
333 * @param roundTripTimeMicros the round-trip duration between the ping b eing sent and the
334 * acknowledgement received
335 */
336 public abstract void pingAcknowledged(long roundTripTimeMicros);
337
338 /**
339 * Invoked when a ping fails. The given argument is the cause of the fai lure.
340 *
341 * @param cause the cause of the ping failure
342 */
343 public abstract void pingFailed(CronetException cause);
344 }
345
346 /**
347 * Starts the stream, all callbacks go to the {@code callback} argument pass ed to {@link 325 * Starts the stream, all callbacks go to the {@code callback} argument pass ed to {@link
348 * BidirectionalStream.Builder}'s constructor. Should only be called once. 326 * BidirectionalStream.Builder}'s constructor. Should only be called once.
349 */ 327 */
350 public abstract void start(); 328 public abstract void start();
351 329
352 /** 330 /**
353 * Reads data from the stream into the provided buffer. 331 * Reads data from the stream into the provided buffer.
354 * Can only be called at most once in response to each invocation of the 332 * Can only be called at most once in response to each invocation of the
355 * {@link Callback#onStreamReady onStreamReady()}/ 333 * {@link Callback#onStreamReady onStreamReady()}/
356 * {@link Callback#onResponseHeadersReceived onResponseHeadersReceived()} an d {@link 334 * {@link Callback#onResponseHeadersReceived onResponseHeadersReceived()} an d {@link
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 378
401 /** 379 /**
402 * Flushes pending writes. This method should not be invoked before {@link 380 * Flushes pending writes. This method should not be invoked before {@link
403 * Callback#onStreamReady onStreamReady()}. For previously delayed {@link 381 * Callback#onStreamReady onStreamReady()}. For previously delayed {@link
404 * #write write()}s, a corresponding {@link Callback#onWriteCompleted onWrit eCompleted()} 382 * #write write()}s, a corresponding {@link Callback#onWriteCompleted onWrit eCompleted()}
405 * will be invoked when the buffer is sent. 383 * will be invoked when the buffer is sent.
406 */ 384 */
407 public abstract void flush(); 385 public abstract void flush();
408 386
409 /** 387 /**
410 * Pings remote end-point. {@code callback} methods will be invoked on {@cod e executor}.
411 *
412 * @param callback the callback that will be invoked when ping succeeds or f ails
413 * @param executor the executor on which the callback will be invoked
414 */
415 // TODO(mef): May be last thing to be implemented on Android.
416 public abstract void ping(PingCallback callback, Executor executor);
417
418 /**
419 * Updates stream flow control window.
420 *
421 * @param windowSizeIncrement the value in bytes to increment window by. May be negative.
422 */
423 // TODO(mef): Understand the needs and semantics of this method.
424 public abstract void windowUpdate(int windowSizeIncrement);
425
426 /**
427 * Cancels the stream. Can be called at any time after {@link #start}. 388 * Cancels the stream. Can be called at any time after {@link #start}.
428 * {@link Callback#onCanceled onCanceled()} will be invoked when cancelation 389 * {@link Callback#onCanceled onCanceled()} will be invoked when cancelation
429 * is complete and no further callback methods will be invoked. If the 390 * is complete and no further callback methods will be invoked. If the
430 * stream has completed or has not started, calling {@code cancel()} has no 391 * stream has completed or has not started, calling {@code cancel()} has no
431 * effect and {@code onCanceled()} will not be invoked. If the 392 * effect and {@code onCanceled()} will not be invoked. If the
432 * {@link Executor} passed in during {@code BidirectionalStream} constructio n runs 393 * {@link Executor} passed in during {@code BidirectionalStream} constructio n runs
433 * tasks on a single thread, and {@code cancel()} is called on that thread, 394 * tasks on a single thread, and {@code cancel()} is called on that thread,
434 * no listener methods (besides {@code onCanceled()}) will be invoked after 395 * no listener methods (besides {@code onCanceled()}) will be invoked after
435 * {@code cancel()} is called. Otherwise, at most one callback method may be 396 * {@code cancel()} is called. Otherwise, at most one callback method may be
436 * invoked after {@code cancel()} has completed. 397 * invoked after {@code cancel()} has completed.
437 */ 398 */
438 public abstract void cancel(); 399 public abstract void cancel();
439 400
440 /** 401 /**
441 * Returns {@code true} if the stream was successfully started and is now 402 * Returns {@code true} if the stream was successfully started and is now
442 * done (succeeded, canceled, or failed). 403 * done (succeeded, canceled, or failed).
443 * 404 *
444 * @return {@code true} if the stream was successfully started and is now 405 * @return {@code true} if the stream was successfully started and is now
445 * done (completed, canceled, or failed), otherwise returns {@code f alse} 406 * done (completed, canceled, or failed), otherwise returns {@code f alse}
446 * to indicate stream is not yet started or is in progress. 407 * to indicate stream is not yet started or is in progress.
447 */ 408 */
448 public abstract boolean isDone(); 409 public abstract boolean isDone();
449 } 410 }
OLDNEW
« no previous file with comments | « no previous file | components/cronet/android/java/src/org/chromium/net/CronetBidirectionalStream.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698