| Index: chrome/renderer/security_filter_peer.cc
|
| diff --git a/chrome/renderer/security_filter_peer.cc b/chrome/renderer/security_filter_peer.cc
|
| index 7d986843e77f6902304f5e1fa16fa449482d3669..aaadaee2c438cec219f792380debcf91eb4ac6b9 100644
|
| --- a/chrome/renderer/security_filter_peer.cc
|
| +++ b/chrome/renderer/security_filter_peer.cc
|
| @@ -70,6 +70,8 @@ void SecurityFilterPeer::OnUploadProgress(uint64 position, uint64 size) {
|
| bool SecurityFilterPeer::OnReceivedRedirect(
|
| const GURL& new_url,
|
| const webkit_glue::ResourceResponseInfo& info,
|
| + const base::TimeTicks& request_start_time,
|
| + const base::TimeTicks& response_start_time,
|
| bool* has_new_first_party_for_cookies,
|
| GURL* new_first_party_for_cookies) {
|
| NOTREACHED();
|
| @@ -77,7 +79,9 @@ bool SecurityFilterPeer::OnReceivedRedirect(
|
| }
|
|
|
| void SecurityFilterPeer::OnReceivedResponse(
|
| - const webkit_glue::ResourceResponseInfo& info) {
|
| + const webkit_glue::ResourceResponseInfo& info,
|
| + const base::TimeTicks& request_start_time,
|
| + const base::TimeTicks& response_start_time) {
|
| NOTREACHED();
|
| }
|
|
|
| @@ -87,9 +91,10 @@ void SecurityFilterPeer::OnReceivedData(const char* data,
|
| NOTREACHED();
|
| }
|
|
|
| -void SecurityFilterPeer::OnCompletedRequest(const net::URLRequestStatus& status,
|
| - const std::string& security_info,
|
| - const base::Time& completion_time) {
|
| +void SecurityFilterPeer::OnCompletedRequest(
|
| + const net::URLRequestStatus& status,
|
| + const std::string& security_info,
|
| + const base::TimeTicks& completion_time) {
|
| NOTREACHED();
|
| }
|
|
|
| @@ -137,8 +142,12 @@ BufferedPeer::~BufferedPeer() {
|
| }
|
|
|
| void BufferedPeer::OnReceivedResponse(
|
| - const webkit_glue::ResourceResponseInfo& info) {
|
| + const webkit_glue::ResourceResponseInfo& info,
|
| + const base::TimeTicks& request_start_time,
|
| + const base::TimeTicks& response_start_time) {
|
| ProcessResponseInfo(info, &response_info_, mime_type_);
|
| + request_start_time_ = request_start_time;
|
| + response_start_time_ = response_start_time;
|
| }
|
|
|
| void BufferedPeer::OnReceivedData(const char* data,
|
| @@ -147,23 +156,28 @@ void BufferedPeer::OnReceivedData(const char* data,
|
| data_.append(data, data_length);
|
| }
|
|
|
| -void BufferedPeer::OnCompletedRequest(const net::URLRequestStatus& status,
|
| - const std::string& security_info,
|
| - const base::Time& completion_time) {
|
| +void BufferedPeer::OnCompletedRequest(
|
| + const net::URLRequestStatus& status,
|
| + const std::string& security_info,
|
| + const base::TimeTicks& completion_time) {
|
| // Make sure we delete ourselves at the end of this call.
|
| scoped_ptr<BufferedPeer> this_deleter(this);
|
|
|
| // Give sub-classes a chance at altering the data.
|
| if (status.status() != net::URLRequestStatus::SUCCESS || !DataReady()) {
|
| // Pretend we failed to load the resource.
|
| - original_peer_->OnReceivedResponse(response_info_);
|
| + original_peer_->OnReceivedResponse(response_info_,
|
| + request_start_time_,
|
| + response_start_time_);
|
| net::URLRequestStatus status(net::URLRequestStatus::CANCELED,
|
| net::ERR_ABORTED);
|
| original_peer_->OnCompletedRequest(status, security_info, completion_time);
|
| return;
|
| }
|
|
|
| - original_peer_->OnReceivedResponse(response_info_);
|
| + original_peer_->OnReceivedResponse(response_info_,
|
| + request_start_time_,
|
| + response_start_time_);
|
| if (!data_.empty())
|
| original_peer_->OnReceivedData(data_.data(),
|
| static_cast<int>(data_.size()),
|
| @@ -188,7 +202,11 @@ ReplaceContentPeer::~ReplaceContentPeer() {
|
| }
|
|
|
| void ReplaceContentPeer::OnReceivedResponse(
|
| - const webkit_glue::ResourceResponseInfo& info) {
|
| + const webkit_glue::ResourceResponseInfo& info,
|
| + const base::TimeTicks& request_start_time,
|
| + const base::TimeTicks& response_start_time) {
|
| + request_start_time_ = request_start_time;
|
| + response_start_time_ = response_start_time;
|
| // Ignore this, we'll serve some alternate content in OnCompletedRequest.
|
| }
|
|
|
| @@ -201,12 +219,14 @@ void ReplaceContentPeer::OnReceivedData(const char* data,
|
| void ReplaceContentPeer::OnCompletedRequest(
|
| const net::URLRequestStatus& status,
|
| const std::string& security_info,
|
| - const base::Time& completion_time) {
|
| + const base::TimeTicks& completion_time) {
|
| webkit_glue::ResourceResponseInfo info;
|
| ProcessResponseInfo(info, &info, mime_type_);
|
| info.security_info = security_info;
|
| info.content_length = static_cast<int>(data_.size());
|
| - original_peer_->OnReceivedResponse(info);
|
| + original_peer_->OnReceivedResponse(info,
|
| + request_start_time_,
|
| + response_start_time_);
|
| if (!data_.empty())
|
| original_peer_->OnReceivedData(data_.data(),
|
| static_cast<int>(data_.size()),
|
|
|