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

Unified Diff: chrome/browser/browsing_data/media_license_counter.h

Issue 2075023002: UI Changes to support clearing EME/CDM data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: chrome/browser/browsing_data/media_license_counter.h
diff --git a/chrome/browser/browsing_data/media_license_counter.h b/chrome/browser/browsing_data/media_license_counter.h
new file mode 100644
index 0000000000000000000000000000000000000000..f1745553eac3a0000aba8ba34d9d9eedc0ce53eb
--- /dev/null
+++ b/chrome/browser/browsing_data/media_license_counter.h
@@ -0,0 +1,55 @@
+// Copyright (c) 2016 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 CHROME_BROWSER_BROWSING_DATA_MEDIA_LICENSE_COUNTER_H_
xhwang 2016/06/17 06:24:30 This file should be media_license*s*_counter.h to
jrummell 2016/06/21 00:13:44 Hmmm. There is autofill_counter, cache_counter, bu
+#define CHROME_BROWSER_BROWSING_DATA_MEDIA_LICENSE_COUNTER_H_
+
+#include <set>
+#include <string>
+
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/browsing_data/browsing_data_counter.h"
+#include "url/gurl.h"
+
+// MediaLicenseCounter is used to determine the number of origins that
+// have plugin private filesystem data (used by EME). It does not include
+// origins that have content licenses owned by Flash.
+class MediaLicenseCounter : public BrowsingDataCounter {
+ public:
+ // MediaLicenseResult is the result of counting the number of origins
+ // that have plugin private filesystem data. It also contains one of the
+ // origins so that a message can displayed providing an example of the
+ // origins that hold content licenses.
+ class MediaLicenseResult : public FinishedResult {
+ public:
+ MediaLicenseResult(const MediaLicenseCounter* source,
+ std::set<GURL> origins);
xhwang 2016/06/17 06:24:30 pass origins by const-ref to avoid copy?
jrummell 2016/06/21 00:13:44 Done.
+ ~MediaLicenseResult() override;
+
+ const std::string& GetOneOrigin() const;
+
+ private:
+ std::string one_origin_;
+ };
+
+ MediaLicenseCounter();
+ ~MediaLicenseCounter() override;
+
+ // BrowsingDataCounter implementation.
+ const std::string& GetPrefName() const final;
+
+ private:
+ // BrowsingDataCounter implementation.
+ void Count() final;
+
+ // Determining the set of origins used by the plugin private filesystem is
+ // done asynchronously. This callback returns the results, which are
+ // subsequently reported.
+ void OnContentLicensesObtained(std::set<GURL> origins);
xhwang 2016/06/17 06:24:30 pass by const ref
jrummell 2016/06/21 00:13:44 Done.
+
+ const std::string pref_name_;
+ base::WeakPtrFactory<MediaLicenseCounter> weak_ptr_factory_;
+};
+
+#endif // CHROME_BROWSER_BROWSING_DATA_MEDIA_LICENSE_COUNTER_H_

Powered by Google App Engine
This is Rietveld 408576698