diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-21 13:51:32 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-21 13:51:32 +0000 |
commit | 7082b2329218da9a77fd6bc9587e86d0ed817196 (patch) | |
tree | dfc92b8bec2e649dc05e011743bf846bffb8151f /chrome/browser | |
parent | 598b1ff52fea0f167462f5bd92070756b9a65090 (diff) | |
download | chromium_src-7082b2329218da9a77fd6bc9587e86d0ed817196.zip chromium_src-7082b2329218da9a77fd6bc9587e86d0ed817196.tar.gz chromium_src-7082b2329218da9a77fd6bc9587e86d0ed817196.tar.bz2 |
Add the actual data being read to the OnBytesRead callback.
This is needed for code at http://code.google.com/p/page-speed/source/browse/bin/trunk/src/pagespeed/pagespeed_input_populator.cc#148
Contributed by: bmcquade@google.com
BUG=48192
TEST=Added new unit tests, ran net_unittests.
Review URL: http://codereview.chromium.org/2849041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53178 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/chromeos/cros/network_library.cc | 5 | ||||
-rw-r--r-- | chrome/browser/chromeos/cros/network_library.h | 2 | ||||
-rw-r--r-- | chrome/browser/task_manager.cc | 3 | ||||
-rw-r--r-- | chrome/browser/task_manager.h | 4 |
4 files changed, 8 insertions, 6 deletions
diff --git a/chrome/browser/chromeos/cros/network_library.cc b/chrome/browser/chromeos/cros/network_library.cc index 6e13d62..2345abd 100644 --- a/chrome/browser/chromeos/cros/network_library.cc +++ b/chrome/browser/chromeos/cros/network_library.cc @@ -243,11 +243,12 @@ void NetworkLibraryImpl::OnJobDone(URLRequestJob* job, } void NetworkLibraryImpl::OnJobRedirect(URLRequestJob* job, const GURL& location, - int status_code) { + int status_code) { CheckNetworkTraffic(false); } -void NetworkLibraryImpl::OnBytesRead(URLRequestJob* job, int byte_count) { +void NetworkLibraryImpl::OnBytesRead(URLRequestJob* job, const char* buf, + int byte_count) { CheckNetworkTraffic(true); } diff --git a/chrome/browser/chromeos/cros/network_library.h b/chrome/browser/chromeos/cros/network_library.h index b01089e..be7df1b 100644 --- a/chrome/browser/chromeos/cros/network_library.h +++ b/chrome/browser/chromeos/cros/network_library.h @@ -383,7 +383,7 @@ class NetworkLibraryImpl : public NetworkLibrary, virtual void OnJobDone(URLRequestJob* job, const URLRequestStatus& status); virtual void OnJobRedirect(URLRequestJob* job, const GURL& location, int status_code); - virtual void OnBytesRead(URLRequestJob* job, int byte_count); + virtual void OnBytesRead(URLRequestJob* job, const char* buf, int byte_count); // NetworkLibrary overrides. virtual void AddObserver(Observer* observer); diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc index 1d2907a..1ac1410 100644 --- a/chrome/browser/task_manager.cc +++ b/chrome/browser/task_manager.cc @@ -835,7 +835,8 @@ void TaskManagerModel::OnJobRedirect(URLRequestJob* job, int status_code) { } -void TaskManagerModel::OnBytesRead(URLRequestJob* job, int byte_count) { +void TaskManagerModel::OnBytesRead(URLRequestJob* job, const char* buf, + int byte_count) { int render_process_host_child_id = -1, routing_id = -1; ResourceDispatcherHost::RenderViewForRequest(job->request(), &render_process_host_child_id, diff --git a/chrome/browser/task_manager.h b/chrome/browser/task_manager.h index 21cb7e6..9d84c4c 100644 --- a/chrome/browser/task_manager.h +++ b/chrome/browser/task_manager.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -238,7 +238,7 @@ class TaskManagerModel : public URLRequestJobTracker::JobObserver, void OnJobRemoved(URLRequestJob* job); void OnJobDone(URLRequestJob* job, const URLRequestStatus& status); void OnJobRedirect(URLRequestJob* job, const GURL& location, int status_code); - void OnBytesRead(URLRequestJob* job, int byte_count); + void OnBytesRead(URLRequestJob* job, const char* buf, int byte_count); void AddResourceProvider(TaskManager::ResourceProvider* provider); void RemoveResourceProvider(TaskManager::ResourceProvider* provider); |