Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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_BROWSING_DATA_MEDIA_LICENSES_COUNTER_H_ | |
| 6 #define CHROME_BROWSER_BROWSING_DATA_MEDIA_LICENSES_COUNTER_H_ | |
| 7 | |
| 8 #include <set> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/memory/weak_ptr.h" | |
| 12 #include "chrome/browser/browsing_data/browsing_data_counter.h" | |
| 13 #include "url/gurl.h" | |
| 14 | |
| 15 // MediaLicenseCounter is used to determine the number of origins that | |
| 16 // have plugin private filesystem data (used by EME). It does not include | |
| 17 // origins that have content licenses owned by Flash. | |
| 18 class MediaLicenseCounter : public BrowsingDataCounter { | |
|
msramek
2016/06/28 09:07:51
Sorry, I missed this before: This should be MediaL
jrummell
2016/06/28 18:12:47
Done.
| |
| 19 public: | |
| 20 // MediaLicenseResult is the result of counting the number of origins | |
| 21 // that have plugin private filesystem data. It also contains one of the | |
| 22 // origins so that a message can displayed providing an example of the | |
| 23 // origins that hold content licenses. | |
| 24 class MediaLicenseResult : public FinishedResult { | |
| 25 public: | |
| 26 MediaLicenseResult(const MediaLicenseCounter* source, | |
| 27 const std::set<GURL>& origins); | |
| 28 ~MediaLicenseResult() override; | |
| 29 | |
| 30 const std::string& GetOneOrigin() const; | |
| 31 | |
| 32 private: | |
| 33 std::string one_origin_; | |
| 34 }; | |
| 35 | |
| 36 MediaLicenseCounter(); | |
| 37 ~MediaLicenseCounter() override; | |
| 38 | |
| 39 // BrowsingDataCounter implementation. | |
| 40 const std::string& GetPrefName() const final; | |
| 41 | |
| 42 private: | |
| 43 // BrowsingDataCounter implementation. | |
| 44 void Count() final; | |
| 45 | |
| 46 // Determining the set of origins used by the plugin private filesystem is | |
| 47 // done asynchronously. This callback returns the results, which are | |
| 48 // subsequently reported. | |
| 49 void OnContentLicensesObtained(const std::set<GURL>& origins); | |
| 50 | |
| 51 const std::string pref_name_; | |
| 52 base::WeakPtrFactory<MediaLicenseCounter> weak_ptr_factory_; | |
| 53 }; | |
| 54 | |
| 55 #endif // CHROME_BROWSER_BROWSING_DATA_MEDIA_LICENSES_COUNTER_H_ | |
| OLD | NEW |