| // Copyright 2021 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef WEBLAYER_BROWSER_WEBLAYER_PAGE_LOAD_METRICS_MEMORY_TRACKER_FACTORY_H_ |
| #define WEBLAYER_BROWSER_WEBLAYER_PAGE_LOAD_METRICS_MEMORY_TRACKER_FACTORY_H_ |
| |
| #include "components/keyed_service/content/browser_context_keyed_service_factory.h" |
| |
| namespace page_load_metrics { |
| class PageLoadMetricsMemoryTracker; |
| } // namespace page_load_metrics |
| |
| namespace weblayer { |
| |
| class WeblayerPageLoadMetricsMemoryTrackerFactory |
| : public BrowserContextKeyedServiceFactory { |
| public: |
| static page_load_metrics::PageLoadMetricsMemoryTracker* GetForBrowserContext( |
| content::BrowserContext* context); |
| |
| static WeblayerPageLoadMetricsMemoryTrackerFactory* GetInstance(); |
| |
| WeblayerPageLoadMetricsMemoryTrackerFactory(); |
| |
| private: |
| // BrowserContextKeyedServiceFactory: |
| bool ServiceIsCreatedWithBrowserContext() const override; |
| |
| KeyedService* BuildServiceInstanceFor( |
| content::BrowserContext* context) const override; |
| |
| content::BrowserContext* GetBrowserContextToUse( |
| content::BrowserContext* context) const override; |
| }; |
| |
| } // namespace weblayer |
| |
| #endif // WEBLAYER_BROWSER_WEBLAYER_PAGE_LOAD_METRICS_MEMORY_TRACKER_FACTORY_H_ |