Commit fb6bf444 authored by hirono's avatar hirono Committed by Commit bot

Report detailed batch upload error by UMA.

Currently chrome reports HTTP response code to UMA and it always -1 when
the HTTP connection is failed.
The CL let chrome report net status error instead if the response code
is -1.

BUG=539608
TEST=Sync multiple files in Files.app.

Review-Url: https://codereview.chromium.org/2163903002
Cr-Commit-Position: refs/heads/master@{#408926}
parent 43ceb11f
......@@ -1363,11 +1363,18 @@ std::vector<std::string> BatchUploadRequest::GetExtraRequestHeaders() const {
void BatchUploadRequest::ProcessURLFetchResults(const net::URLFetcher* source) {
// Return the detailed raw HTTP code if the error code is abstracted
// DRIVE_OTHER_ERROR.
UMA_HISTOGRAM_SPARSE_SLOWLY(kUMADriveBatchUploadResponseCode,
GetErrorCode() != DRIVE_OTHER_ERROR
? GetErrorCode()
: source->GetResponseCode());
// DRIVE_OTHER_ERROR. If HTTP connection is failed and the status code is -1,
// return network status error.
int histogram_error = 0;
if (GetErrorCode() != DRIVE_OTHER_ERROR) {
histogram_error = GetErrorCode();
} else if (source->GetResponseCode() != -1) {
histogram_error = source->GetResponseCode();
} else {
histogram_error = source->GetStatus().error();
}
UMA_HISTOGRAM_SPARSE_SLOWLY(
kUMADriveBatchUploadResponseCode, histogram_error);
if (!IsSuccessfulDriveApiErrorCode(GetErrorCode())) {
RunCallbackOnPrematureFailure(GetErrorCode());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment