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

Side by Side Diff: components/cronet/android/test/javaperftests/src/org/chromium/net/CronetPerfTestActivity.java

Issue 1359343005: Update ResponseInfo to UrlResponseInfo with API review comments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update README.md Created 5 years, 2 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 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.app.Activity; 8 import android.app.Activity;
9 import android.net.Uri; 9 import android.net.Uri;
10 import android.os.AsyncTask; 10 import android.os.AsyncTask;
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 private class Listener extends UrlRequestListener { 383 private class Listener extends UrlRequestListener {
384 private final ByteBuffer mBuffer; 384 private final ByteBuffer mBuffer;
385 private final Runnable mCompletionCallback; 385 private final Runnable mCompletionCallback;
386 386
387 Listener(ByteBuffer buffer, Runnable completionCallback) { 387 Listener(ByteBuffer buffer, Runnable completionCallback) {
388 mBuffer = buffer; 388 mBuffer = buffer;
389 mCompletionCallback = completionCallback; 389 mCompletionCallback = completionCallback;
390 } 390 }
391 391
392 @Override 392 @Override
393 public void onResponseStarted(UrlRequest request, ResponseInfo i nfo) { 393 public void onResponseStarted(UrlRequest request, UrlResponseInf o info) {
394 mBuffer.clear(); 394 mBuffer.clear();
395 request.readNew(mBuffer); 395 request.readNew(mBuffer);
396 } 396 }
397 397
398 @Override 398 @Override
399 public void onReceivedRedirect( 399 public void onReceivedRedirect(
400 UrlRequest request, ResponseInfo info, String newLocatio nUrl) { 400 UrlRequest request, UrlResponseInfo info, String newLoca tionUrl) {
401 request.followRedirect(); 401 request.followRedirect();
402 } 402 }
403 403
404 @Override 404 @Override
405 public void onReadCompleted( 405 public void onReadCompleted(
406 UrlRequest request, ResponseInfo info, ByteBuffer byteBu ffer) { 406 UrlRequest request, UrlResponseInfo info, ByteBuffer byt eBuffer) {
407 mBuffer.clear(); 407 mBuffer.clear();
408 request.readNew(mBuffer); 408 request.readNew(mBuffer);
409 } 409 }
410 410
411 @Override 411 @Override
412 public void onSucceeded(UrlRequest request, ExtendedResponseInfo info) { 412 public void onSucceeded(UrlRequest request, UrlResponseInfo info ) {
413 mCompletionCallback.run(); 413 mCompletionCallback.run();
414 } 414 }
415 415
416 @Override 416 @Override
417 public void onFailed(UrlRequest request, ResponseInfo info, UrlR equestException e) { 417 public void onFailed(
418 UrlRequest request, UrlResponseInfo info, UrlRequestExce ption e) {
418 System.out.println("Async request failed with " + e); 419 System.out.println("Async request failed with " + e);
419 mFailed = true; 420 mFailed = true;
420 } 421 }
421 } 422 }
422 423
423 private void postToWorkQueue(Runnable task) { 424 private void postToWorkQueue(Runnable task) {
424 try { 425 try {
425 mWorkQueue.put(task); 426 mWorkQueue.put(task);
426 } catch (InterruptedException e) { 427 } catch (InterruptedException e) {
427 mFailed = true; 428 mFailed = true;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 } 580 }
580 581
581 @Override 582 @Override
582 public void onCreate(Bundle savedInstanceState) { 583 public void onCreate(Bundle savedInstanceState) {
583 super.onCreate(savedInstanceState); 584 super.onCreate(savedInstanceState);
584 mConfig = getIntent().getData(); 585 mConfig = getIntent().getData();
585 // Execute benchmarks on another thread to avoid networking on main thre ad. 586 // Execute benchmarks on another thread to avoid networking on main thre ad.
586 new BenchmarkTask().execute(); 587 new BenchmarkTask().execute();
587 } 588 }
588 } 589 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698