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

Side by Side Diff: components/cryptauth/cryptauth_api_call_flow.cc

Issue 2888053003: Network traffic annotation added to OAuth2ApiCallFlow and its subclasses. (Closed)
Patch Set: Annotations updated. 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 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/cryptauth/cryptauth_api_call_flow.h" 5 #include "components/cryptauth/cryptauth_api_call_flow.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "components/proximity_auth/logging/logging.h" 8 #include "components/proximity_auth/logging/logging.h"
9 #include "net/traffic_annotation/network_traffic_annotation.h"
9 #include "net/url_request/url_fetcher.h" 10 #include "net/url_request/url_fetcher.h"
10 11
11 namespace cryptauth { 12 namespace cryptauth {
12 13
13 namespace { 14 namespace {
14 15
15 const char kResponseBodyError[] = "Failed to get response body"; 16 const char kResponseBodyError[] = "Failed to get response body";
16 const char kRequestFailedError[] = "Request failed"; 17 const char kRequestFailedError[] = "Request failed";
17 const char kHttpStatusErrorPrefix[] = "HTTP status: "; 18 const char kHttpStatusErrorPrefix[] = "HTTP status: ";
18 19
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } else { 74 } else {
74 error_message = kRequestFailedError; 75 error_message = kRequestFailedError;
75 } 76 }
76 77
77 std::string response; 78 std::string response;
78 source->GetResponseAsString(&response); 79 source->GetResponseAsString(&response);
79 PA_LOG(INFO) << "API call failed:\n" << response; 80 PA_LOG(INFO) << "API call failed:\n" << response;
80 error_callback_.Run(error_message); 81 error_callback_.Run(error_message);
81 } 82 }
82 83
84 net::PartialNetworkTrafficAnnotationTag
85 CryptAuthApiCallFlow::GetNetworkTrafficAnnotationTag() {
86 DCHECK(partial_network_annotation_ != nullptr);
87 return *partial_network_annotation_.get();
88 }
89
83 } // namespace cryptauth 90 } // namespace cryptauth
OLDNEW
« no previous file with comments | « components/cryptauth/cryptauth_api_call_flow.h ('k') | components/cryptauth/cryptauth_api_call_flow_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698