| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/browsing_data/browsing_data_counter.h" | 5 #include "chrome/browser/browsing_data/browsing_data_counter.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 10 | 12 |
| 11 BrowsingDataCounter::BrowsingDataCounter() {} | 13 BrowsingDataCounter::BrowsingDataCounter() {} |
| 12 | 14 |
| 13 BrowsingDataCounter::~BrowsingDataCounter() { | 15 BrowsingDataCounter::~BrowsingDataCounter() { |
| 14 } | 16 } |
| 15 | 17 |
| 16 void BrowsingDataCounter::Init( | 18 void BrowsingDataCounter::Init( |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 Count(); | 60 Count(); |
| 59 } | 61 } |
| 60 | 62 |
| 61 void BrowsingDataCounter::ReportResult(ResultInt value) { | 63 void BrowsingDataCounter::ReportResult(ResultInt value) { |
| 62 DCHECK(initialized_); | 64 DCHECK(initialized_); |
| 63 callback_.Run(make_scoped_ptr(new FinishedResult(this, value))); | 65 callback_.Run(make_scoped_ptr(new FinishedResult(this, value))); |
| 64 } | 66 } |
| 65 | 67 |
| 66 void BrowsingDataCounter::ReportResult(scoped_ptr<Result> result) { | 68 void BrowsingDataCounter::ReportResult(scoped_ptr<Result> result) { |
| 67 DCHECK(initialized_); | 69 DCHECK(initialized_); |
| 68 callback_.Run(result.Pass()); | 70 callback_.Run(std::move(result)); |
| 69 } | 71 } |
| 70 | 72 |
| 71 // BrowsingDataCounter::Result ------------------------------------------------- | 73 // BrowsingDataCounter::Result ------------------------------------------------- |
| 72 | 74 |
| 73 BrowsingDataCounter::Result::Result(const BrowsingDataCounter* source) | 75 BrowsingDataCounter::Result::Result(const BrowsingDataCounter* source) |
| 74 : source_(source) { | 76 : source_(source) { |
| 75 } | 77 } |
| 76 | 78 |
| 77 BrowsingDataCounter::Result::~Result() { | 79 BrowsingDataCounter::Result::~Result() { |
| 78 } | 80 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 93 } | 95 } |
| 94 | 96 |
| 95 bool BrowsingDataCounter::FinishedResult::Finished() const { | 97 bool BrowsingDataCounter::FinishedResult::Finished() const { |
| 96 return true; | 98 return true; |
| 97 } | 99 } |
| 98 | 100 |
| 99 BrowsingDataCounter::ResultInt | 101 BrowsingDataCounter::ResultInt |
| 100 BrowsingDataCounter::FinishedResult::Value() const { | 102 BrowsingDataCounter::FinishedResult::Value() const { |
| 101 return value_; | 103 return value_; |
| 102 } | 104 } |
| OLD | NEW |