OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/password_manager/core/browser/affiliation_service.h" | 5 #include "components/password_manager/core/browser/affiliation_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 make_scoped_ptr(new base::DefaultTickClock)); | 43 make_scoped_ptr(new base::DefaultTickClock)); |
44 | 44 |
45 scoped_ptr<base::TickClock> tick_clock(new base::DefaultTickClock); | 45 scoped_ptr<base::TickClock> tick_clock(new base::DefaultTickClock); |
46 backend_task_runner_->PostTask( | 46 backend_task_runner_->PostTask( |
47 FROM_HERE, base::Bind(&AffiliationBackend::Initialize, | 47 FROM_HERE, base::Bind(&AffiliationBackend::Initialize, |
48 base::Unretained(backend_), db_path)); | 48 base::Unretained(backend_), db_path)); |
49 } | 49 } |
50 | 50 |
51 void AffiliationService::GetAffiliations( | 51 void AffiliationService::GetAffiliations( |
52 const FacetURI& facet_uri, | 52 const FacetURI& facet_uri, |
53 bool cached_only, | 53 StrategyOnCacheMiss cache_miss_strategy, |
54 const ResultCallback& result_callback) { | 54 const ResultCallback& result_callback) { |
55 DCHECK(thread_checker_.CalledOnValidThread()); | 55 DCHECK(thread_checker_.CalledOnValidThread()); |
56 DCHECK(backend_); | 56 DCHECK(backend_); |
57 backend_task_runner_->PostTask( | 57 backend_task_runner_->PostTask( |
58 FROM_HERE, | 58 FROM_HERE, |
59 base::Bind(&AffiliationBackend::GetAffiliations, | 59 base::Bind(&AffiliationBackend::GetAffiliations, |
60 base::Unretained(backend_), facet_uri, cached_only, | 60 base::Unretained(backend_), facet_uri, cache_miss_strategy, |
61 result_callback, base::ThreadTaskRunnerHandle::Get())); | 61 result_callback, base::ThreadTaskRunnerHandle::Get())); |
62 } | 62 } |
63 | 63 |
64 void AffiliationService::Prefetch(const FacetURI& facet_uri, | 64 void AffiliationService::Prefetch(const FacetURI& facet_uri, |
65 const base::Time& keep_fresh_until) { | 65 const base::Time& keep_fresh_until) { |
66 DCHECK(thread_checker_.CalledOnValidThread()); | 66 DCHECK(thread_checker_.CalledOnValidThread()); |
67 DCHECK(backend_); | 67 DCHECK(backend_); |
68 backend_task_runner_->PostTask( | 68 backend_task_runner_->PostTask( |
69 FROM_HERE, | 69 FROM_HERE, |
70 base::Bind(&AffiliationBackend::Prefetch, base::Unretained(backend_), | 70 base::Bind(&AffiliationBackend::Prefetch, base::Unretained(backend_), |
(...skipping 12 matching lines...) Expand all Loading... |
83 | 83 |
84 void AffiliationService::TrimCache() { | 84 void AffiliationService::TrimCache() { |
85 DCHECK(thread_checker_.CalledOnValidThread()); | 85 DCHECK(thread_checker_.CalledOnValidThread()); |
86 DCHECK(backend_); | 86 DCHECK(backend_); |
87 backend_task_runner_->PostTask( | 87 backend_task_runner_->PostTask( |
88 FROM_HERE, | 88 FROM_HERE, |
89 base::Bind(&AffiliationBackend::TrimCache, base::Unretained(backend_))); | 89 base::Bind(&AffiliationBackend::TrimCache, base::Unretained(backend_))); |
90 } | 90 } |
91 | 91 |
92 } // namespace password_manager | 92 } // namespace password_manager |
OLD | NEW |