| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/browsing_data/media_licenses_counter.h" | 5 #include "chrome/browser/browsing_data/media_licenses_counter.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/task_runner_util.h" | 11 #include "base/task_runner_util.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "components/browsing_data/pref_names.h" | 13 #include "components/browsing_data/core/pref_names.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/storage_partition.h" | 15 #include "content/public/browser/storage_partition.h" |
| 16 #include "storage/browser/fileapi/file_system_context.h" | 16 #include "storage/browser/fileapi/file_system_context.h" |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 // Determining the origins must be run on the file task thread. | 20 // Determining the origins must be run on the file task thread. |
| 21 std::set<GURL> CountOriginsOnFileTaskRunner( | 21 std::set<GURL> CountOriginsOnFileTaskRunner( |
| 22 storage::FileSystemContext* filesystem_context) { | 22 storage::FileSystemContext* filesystem_context) { |
| 23 DCHECK(filesystem_context->default_file_task_runner() | 23 DCHECK(filesystem_context->default_file_task_runner() |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 base::RetainedRef(filesystem_context)), | 70 base::RetainedRef(filesystem_context)), |
| 71 base::Bind(&MediaLicensesCounter::OnContentLicensesObtained, | 71 base::Bind(&MediaLicensesCounter::OnContentLicensesObtained, |
| 72 weak_ptr_factory_.GetWeakPtr())); | 72 weak_ptr_factory_.GetWeakPtr())); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void MediaLicensesCounter::OnContentLicensesObtained( | 75 void MediaLicensesCounter::OnContentLicensesObtained( |
| 76 const std::set<GURL>& origins) { | 76 const std::set<GURL>& origins) { |
| 77 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 77 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 78 ReportResult(base::WrapUnique(new MediaLicenseResult(this, origins))); | 78 ReportResult(base::WrapUnique(new MediaLicenseResult(this, origins))); |
| 79 } | 79 } |
| OLD | NEW |