Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/signin/core/browser/refresh_token_annotation_request.h" | 5 #include "components/signin/core/browser/refresh_token_annotation_request.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "components/prefs/pref_service.h" | 14 #include "components/prefs/pref_service.h" |
| 15 #include "components/signin/core/browser/signin_client.h" | 15 #include "components/signin/core/browser/signin_client.h" |
| 16 #include "components/signin/core/common/signin_pref_names.h" | 16 #include "components/signin/core/common/signin_pref_names.h" |
| 17 #include "google_apis/gaia/gaia_constants.h" | 17 #include "google_apis/gaia/gaia_constants.h" |
| 18 #include "google_apis/gaia/gaia_urls.h" | 18 #include "google_apis/gaia/gaia_urls.h" |
| 19 #include "net/base/escape.h" | 19 #include "net/base/escape.h" |
| 20 #include "net/traffic_annotation/network_traffic_annotation.h" | |
| 20 #include "net/url_request/url_request_context_getter.h" | 21 #include "net/url_request/url_request_context_getter.h" |
| 21 | 22 |
| 22 namespace { | 23 namespace { |
| 23 | 24 |
| 24 void RecordRequestStatusHistogram(bool success) { | 25 void RecordRequestStatusHistogram(bool success) { |
| 25 UMA_HISTOGRAM_BOOLEAN("Signin.RefreshTokenAnnotationRequest", success); | 26 UMA_HISTOGRAM_BOOLEAN("Signin.RefreshTokenAnnotationRequest", success); |
| 26 } | 27 } |
| 27 } | 28 } |
| 28 | 29 |
| 29 RefreshTokenAnnotationRequest::RefreshTokenAnnotationRequest( | 30 RefreshTokenAnnotationRequest::RefreshTokenAnnotationRequest( |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 } | 165 } |
| 165 | 166 |
| 166 void RefreshTokenAnnotationRequest::ProcessApiCallFailure( | 167 void RefreshTokenAnnotationRequest::ProcessApiCallFailure( |
| 167 const net::URLFetcher* source) { | 168 const net::URLFetcher* source) { |
| 168 DCHECK(CalledOnValidThread()); | 169 DCHECK(CalledOnValidThread()); |
| 169 DVLOG(2) << "Request failed"; | 170 DVLOG(2) << "Request failed"; |
| 170 RecordRequestStatusHistogram(false); | 171 RecordRequestStatusHistogram(false); |
| 171 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, request_callback_); | 172 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, request_callback_); |
| 172 request_callback_.Reset(); | 173 request_callback_.Reset(); |
| 173 } | 174 } |
| 175 | |
| 176 net::PartialNetworkTrafficAnnotationTag | |
| 177 RefreshTokenAnnotationRequest::GetNetworkTrafficAnnotationTag() { | |
| 178 return net::DefinePartialNetworkTrafficAnnotation("...", | |
| 179 "oauth2_api_call_flow", R"( | |
| 180 semantics { | |
| 181 sender: "..." | |
| 182 description: "..." | |
| 183 trigger: "..." | |
| 184 data: "..." | |
| 185 destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER/LOCAL | |
| 186 } | |
| 187 policy { | |
| 188 setting: "..." | |
| 189 chrome_policy { | |
| 190 [POLICY_NAME] { | |
| 191 policy_options {mode: MANDATORY/RECOMMENDED/UNSET} | |
| 192 [POLICY_NAME]: ... //(value to disable it) | |
| 193 } | |
| 194 } | |
| 195 policy_exception_justification: "..." | |
| 196 })"); | |
| 197 } | |
|
Roger Tawa OOO till Jul 10th
2017/05/26 13:46:10
semantics {
sender: "Account Fetcher Serv
Ramin Halavati
2017/05/29 05:30:52
Done.
| |
| OLD | NEW |