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

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

Issue 18660004: Extension activity log database refactoring (step 1) (Closed) Base URL: http://git.chromium.org/chromium/src.git@incognito-tests
Patch Set: Delegate renaming and comment cleanup Created 7 years, 5 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "chrome/browser/extensions/activity_log/activity_log_policy.h" 9 #include "chrome/browser/extensions/activity_log/activity_log_policy.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/common/extensions/extension.h" 11 #include "chrome/common/extensions/extension.h"
12 #include "url/gurl.h" 12 #include "url/gurl.h"
13 13
14 using base::TimeDelta;
15
16 namespace extensions { 14 namespace extensions {
17 15
18 ActivityLogPolicy::ActivityLogPolicy(Profile* profile) { 16 ActivityLogPolicy::ActivityLogPolicy(Profile* profile) {
19 CHECK(profile && "Null ptr dereference"); 17 CHECK(profile && "Null ptr dereference");
20 profile_base_path_ = profile->GetPath(); 18 profile_base_path_ = profile->GetPath();
21 timer_.Start(FROM_HERE, TimeDelta::FromMinutes(2), this,
22 &ActivityLogPolicy::SaveState);
23 } 19 }
24 20
25 ActivityLogPolicy::~ActivityLogPolicy() { 21 ActivityLogPolicy::~ActivityLogPolicy() {
26 timer_.Stop();
27 }
28
29 void ActivityLogPolicy::SetSaveStateOnRequestOnly() {
30 timer_.Stop();
31 } 22 }
32 23
33 std::string ActivityLogPolicy::GetKey(KeyType) const { 24 std::string ActivityLogPolicy::GetKey(KeyType) const {
34 return std::string(); 25 return std::string();
35 } 26 }
36 27
37 } // namespace extensions 28 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698