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

Side by Side Diff: content/browser/download/download_resource_handler.cc

Issue 11478034: Add UMA for measuring Content-Dispostion header use and abuse. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Suppress accidental trigraph Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/download/download_stats.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "content/browser/download/download_resource_handler.h" 5 #include "content/browser/download/download_resource_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 151
152 info->url_chain = request_->url_chain(); 152 info->url_chain = request_->url_chain();
153 info->referrer_url = GURL(request_->referrer()); 153 info->referrer_url = GURL(request_->referrer());
154 info->start_time = base::Time::Now(); 154 info->start_time = base::Time::Now();
155 info->total_bytes = content_length_; 155 info->total_bytes = content_length_;
156 info->has_user_gesture = request_info->HasUserGesture(); 156 info->has_user_gesture = request_info->HasUserGesture();
157 info->content_disposition = content_disposition_; 157 info->content_disposition = content_disposition_;
158 info->mime_type = response->head.mime_type; 158 info->mime_type = response->head.mime_type;
159 info->remote_address = request_->GetSocketAddress().host(); 159 info->remote_address = request_->GetSocketAddress().host();
160 RecordDownloadMimeType(info->mime_type); 160 RecordDownloadMimeType(info->mime_type);
161 RecordDownloadContentDisposition(info->content_disposition);
161 162
162 info->request_handle = 163 info->request_handle =
163 DownloadRequestHandle(AsWeakPtr(), global_id_.child_id, 164 DownloadRequestHandle(AsWeakPtr(), global_id_.child_id,
164 render_view_id_, global_id_.request_id); 165 render_view_id_, global_id_.request_id);
165 166
166 // Get the last modified time and etag. 167 // Get the last modified time and etag.
167 const net::HttpResponseHeaders* headers = request_->response_headers(); 168 const net::HttpResponseHeaders* headers = request_->response_headers();
168 if (headers) { 169 if (headers) {
169 std::string last_modified_hdr; 170 std::string last_modified_hdr;
170 std::string etag; 171 std::string etag;
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 445
445 // Remove output stream callback if a stream exists. 446 // Remove output stream callback if a stream exists.
446 if (stream_writer_.get()) 447 if (stream_writer_.get())
447 stream_writer_->RegisterCallback(base::Closure()); 448 stream_writer_->RegisterCallback(base::Closure());
448 449
449 UMA_HISTOGRAM_TIMES("SB2.DownloadDuration", 450 UMA_HISTOGRAM_TIMES("SB2.DownloadDuration",
450 base::TimeTicks::Now() - download_start_time_); 451 base::TimeTicks::Now() - download_start_time_);
451 } 452 }
452 453
453 } // namespace content 454 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/download/download_stats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698