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

Side by Side Diff: chrome/browser/extensions/activity_log/activity_log_policy.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extensions/activity_log/activity_log_policy.h" 5 #include "chrome/browser/extensions/activity_log/activity_log_policy.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 20 matching lines...) Expand all
31 "activitylog_blocked", 31 "activitylog_blocked",
32 "activitylog_urls"}; 32 "activitylog_urls"};
33 } // namespace 33 } // namespace
34 34
35 namespace extensions { 35 namespace extensions {
36 36
37 ActivityLogPolicy::ActivityLogPolicy(Profile* profile) {} 37 ActivityLogPolicy::ActivityLogPolicy(Profile* profile) {}
38 38
39 ActivityLogPolicy::~ActivityLogPolicy() {} 39 ActivityLogPolicy::~ActivityLogPolicy() {}
40 40
41 void ActivityLogPolicy::SetClockForTesting(scoped_ptr<base::Clock> clock) { 41 void ActivityLogPolicy::SetClockForTesting(std::unique_ptr<base::Clock> clock) {
42 testing_clock_.reset(clock.release()); 42 testing_clock_.reset(clock.release());
43 } 43 }
44 44
45 base::Time ActivityLogPolicy::Now() const { 45 base::Time ActivityLogPolicy::Now() const {
46 if (testing_clock_) 46 if (testing_clock_)
47 return testing_clock_->Now(); 47 return testing_clock_->Now();
48 else 48 else
49 return base::Time::Now(); 49 return base::Time::Now();
50 } 50 }
51 51
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 127 }
128 } 128 }
129 } 129 }
130 130
131 // static 131 // static
132 void ActivityLogPolicy::Util::StripArguments(const ApiSet& api_whitelist, 132 void ActivityLogPolicy::Util::StripArguments(const ApiSet& api_whitelist,
133 scoped_refptr<Action> action) { 133 scoped_refptr<Action> action) {
134 if (api_whitelist.find( 134 if (api_whitelist.find(
135 std::make_pair(action->action_type(), action->api_name())) == 135 std::make_pair(action->action_type(), action->api_name())) ==
136 api_whitelist.end()) { 136 api_whitelist.end()) {
137 action->set_args(scoped_ptr<base::ListValue>()); 137 action->set_args(std::unique_ptr<base::ListValue>());
138 } 138 }
139 } 139 }
140 140
141 // static 141 // static
142 base::Time ActivityLogPolicy::Util::AddDays(const base::Time& base_date, 142 base::Time ActivityLogPolicy::Util::AddDays(const base::Time& base_date,
143 int days) { 143 int days) {
144 // To allow for time zone changes, add an additional partial day then round 144 // To allow for time zone changes, add an additional partial day then round
145 // down to midnight. 145 // down to midnight.
146 return (base_date + base::TimeDelta::FromDays(days) + 146 return (base_date + base::TimeDelta::FromDays(days) +
147 base::TimeDelta::FromHours(4)).LocalMidnight(); 147 base::TimeDelta::FromHours(4)).LocalMidnight();
(...skipping 25 matching lines...) Expand all
173 base::StringPrintf("DROP TABLE %s", table_name); 173 base::StringPrintf("DROP TABLE %s", table_name);
174 if (!db->Execute(drop_statement.c_str())) { 174 if (!db->Execute(drop_statement.c_str())) {
175 return false; 175 return false;
176 } 176 }
177 } 177 }
178 } 178 }
179 return true; 179 return true;
180 } 180 }
181 181
182 } // namespace extensions 182 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698