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

Unified Diff: components/cryptauth/cryptauth_device_manager.cc

Issue 2888053003: Network traffic annotation added to OAuth2ApiCallFlow and its subclasses. (Closed)
Patch Set: Annotations updated. Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: components/cryptauth/cryptauth_device_manager.cc
diff --git a/components/cryptauth/cryptauth_device_manager.cc b/components/cryptauth/cryptauth_device_manager.cc
index a12def4d66c0475f2ee663e769ef03c2c9e8efae..4cea3fb1fd149fad3b286c26298414fd89cc3b10 100644
--- a/components/cryptauth/cryptauth_device_manager.cc
+++ b/components/cryptauth/cryptauth_device_manager.cc
@@ -18,6 +18,7 @@
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/proximity_auth/logging/logging.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
namespace cryptauth {
@@ -542,11 +543,38 @@ void CryptAuthDeviceManager::OnSyncRequested(
GetMyDevicesRequest request;
request.set_invocation_reason(invocation_reason);
request.set_allow_stale_read(is_sync_speculative);
+ net::PartialNetworkTrafficAnnotationTag partial_traffic_annotation =
+ net::DefinePartialNetworkTrafficAnnotation("cryptauth_get_my_devices",
+ "oauth2_api_call_flow", R"(
+ semantics {
+ sender: "CryptAuth Device Manager"
+ description:
+ "Gets a list of the devices registered (for the same user) on "
+ "CryptAuth."
+ trigger:
+ "Once every day, or by API request. Periodic calls happen because "
+ "devides that do not re-enrolled for more than X days (currently 45) "
+ "are automatically removed from the server."
+ data: "OAuth 2.0 token."
+ destination: GOOGLE_OWNED_SERVICE
+ }
+ policy {
+ setting:
+ "This feature cannot be disabled in settings. However, this request "
+ "is made only for signed-in users."
+ chrome_policy {
+ SigninAllowed {
+ SigninAllowed: false
+ }
+ }
+ })");
cryptauth_client_->GetMyDevices(
- request, base::Bind(&CryptAuthDeviceManager::OnGetMyDevicesSuccess,
- weak_ptr_factory_.GetWeakPtr()),
+ request,
+ base::Bind(&CryptAuthDeviceManager::OnGetMyDevicesSuccess,
+ weak_ptr_factory_.GetWeakPtr()),
base::Bind(&CryptAuthDeviceManager::OnGetMyDevicesFailure,
- weak_ptr_factory_.GetWeakPtr()));
+ weak_ptr_factory_.GetWeakPtr()),
+ partial_traffic_annotation);
}
} // namespace cryptauth
« no previous file with comments | « components/cryptauth/cryptauth_client_impl_unittest.cc ('k') | components/cryptauth/cryptauth_device_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698