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

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

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: simplify type checking Created 3 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
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 // File method ordering: Methods in this file are in the same order as 5 // File method ordering: Methods in this file are in the same order as
6 // in download_item_impl.h, with the following exception: The public 6 // in download_item_impl.h, with the following exception: The public
7 // interface Start is placed in chronological order with the other 7 // interface Start is placed in chronological order with the other
8 // (private) routines that together define a DownloadItem's state 8 // (private) routines that together define a DownloadItem's state
9 // transitions as the download progresses. See "Download progression 9 // transitions as the download progresses. See "Download progression
10 // cascade" later in this file. 10 // cascade" later in this file.
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 if (chain_iter != new_create_info.url_chain.end()) 1109 if (chain_iter != new_create_info.url_chain.end())
1110 origin_state |= ORIGIN_STATE_ON_RESUMPTION_ADDITIONAL_REDIRECTS; 1110 origin_state |= ORIGIN_STATE_ON_RESUMPTION_ADDITIONAL_REDIRECTS;
1111 if (etag_ != new_create_info.etag || 1111 if (etag_ != new_create_info.etag ||
1112 last_modified_time_ != new_create_info.last_modified) { 1112 last_modified_time_ != new_create_info.last_modified) {
1113 received_slices_.clear(); 1113 received_slices_.clear();
1114 destination_info_.received_bytes = 0; 1114 destination_info_.received_bytes = 0;
1115 origin_state |= ORIGIN_STATE_ON_RESUMPTION_VALIDATORS_CHANGED; 1115 origin_state |= ORIGIN_STATE_ON_RESUMPTION_VALIDATORS_CHANGED;
1116 } 1116 }
1117 if (content_disposition_ != new_create_info.content_disposition) 1117 if (content_disposition_ != new_create_info.content_disposition)
1118 origin_state |= ORIGIN_STATE_ON_RESUMPTION_CONTENT_DISPOSITION_CHANGED; 1118 origin_state |= ORIGIN_STATE_ON_RESUMPTION_CONTENT_DISPOSITION_CHANGED;
1119 RecordOriginStateOnResumption(is_partial, origin_state); 1119 RecordOriginStateOnResumption(
1120 is_partial, static_cast<OriginStateOnResumption>(origin_state));
1120 1121
1121 request_info_.url_chain.insert(request_info_.url_chain.end(), chain_iter, 1122 request_info_.url_chain.insert(request_info_.url_chain.end(), chain_iter,
1122 new_create_info.url_chain.end()); 1123 new_create_info.url_chain.end());
1123 etag_ = new_create_info.etag; 1124 etag_ = new_create_info.etag;
1124 last_modified_time_ = new_create_info.last_modified; 1125 last_modified_time_ = new_create_info.last_modified;
1125 response_headers_ = new_create_info.response_headers; 1126 response_headers_ = new_create_info.response_headers;
1126 content_disposition_ = new_create_info.content_disposition; 1127 content_disposition_ = new_create_info.content_disposition;
1127 // It is possible that the previous download attempt failed right before the 1128 // It is possible that the previous download attempt failed right before the
1128 // response is received. Need to reset the MIME type. 1129 // response is received. Need to reset the MIME type.
1129 mime_type_ = new_create_info.mime_type; 1130 mime_type_ = new_create_info.mime_type;
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after
2370 case RESUME_MODE_USER_CONTINUE: 2371 case RESUME_MODE_USER_CONTINUE:
2371 return "USER_CONTINUE"; 2372 return "USER_CONTINUE";
2372 case RESUME_MODE_USER_RESTART: 2373 case RESUME_MODE_USER_RESTART:
2373 return "USER_RESTART"; 2374 return "USER_RESTART";
2374 } 2375 }
2375 NOTREACHED() << "Unknown resume mode " << mode; 2376 NOTREACHED() << "Unknown resume mode " << mode;
2376 return "unknown"; 2377 return "unknown";
2377 } 2378 }
2378 2379
2379 } // namespace content 2380 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_child_process_host_impl.cc ('k') | content/browser/download/download_stats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698