1 // Copyright 2020 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_FEDERATED_LEARNING_FLOC_ID_PROVIDER_H_ 6 #define CHROME_BROWSER_FEDERATED_LEARNING_FLOC_ID_PROVIDER_H_ 7 8 #include "components/federated_learning/floc_id.h" 9 #include "components/keyed_service/core/keyed_service.h" 10 #include "net/cookies/site_for_cookies.h" 11 #include "url/origin.h" 12 13 namespace federated_learning { 14 15 // KeyedService which computes the floc id regularly, and notifies relevant 16 // components about the updated id. 17 class FlocIdProvider : public KeyedService { 18 public: 19 // Get the interest cohort. Use |requesting_origin| and first-party 20 // context |site_for_cookies| for access permission check. 21 virtual std::string GetInterestCohortForJsApi( 22 const url::Origin& requesting_origin, 23 const net::SiteForCookies& site_for_cookies) const = 0; 24 25 ~FlocIdProvider() override = default; 26 }; 27 28 } // namespace federated_learning 29 30 #endif // CHROME_BROWSER_FEDERATED_LEARNING_FLOC_ID_PROVIDER_H_ 31