Index: chrome/browser/extensions/activity_log/activity_log_policy.cc |
diff --git a/chrome/browser/extensions/activity_log/activity_log_policy.cc b/chrome/browser/extensions/activity_log/activity_log_policy.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..225c992a30dc0cbcfdecd1191df517f7dc71caca |
--- /dev/null |
+++ b/chrome/browser/extensions/activity_log/activity_log_policy.cc |
@@ -0,0 +1,39 @@ |
+// Copyright $YEAR The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include <stdint.h> |
+ |
+#include "chrome/browser/extensions/activity_log/activity_log_policy.h" |
+#include "base/logging.h" |
+#include "base/time.h" |
+#include "chrome/browser/profiles/profile.h" |
+#include "chrome/common/extensions/extension.h" |
+#include "googleurl/src/gurl.h" |
+ |
+using namespace base; |
+ |
+namespace extensions { |
+ |
+ActivityLogPolicy::ActivityLogPolicy(Profile* profile, |
+ content::BrowserThread::ID thread_id) |
+ : dispatch_thread_(thread_id) { |
+ CHECK(profile && "Null ptr dereference"); |
+ profile_base_path_ = profile->GetPath(); |
+ timer_.Start(FROM_HERE, TimeDelta::FromMinutes(2), this, |
+ &ActivityLogPolicy::SaveState); |
felt
2013/05/24 18:43:38
OK, I was confused. I thought you were going to mo
dbabic
2013/05/28 21:11:49
I think we still need to implement this in Activit
felt
2013/05/29 03:41:15
Huh? The ActivityDatabase batching code isn't savi
dbabic
2013/05/29 18:41:40
Note that the current policies don't implement Sav
felt
2013/05/29 19:12:29
OK, so there will be two simultaneous timers going
felt
2013/05/29 19:22:35
Another thing that came to mind: when shutting dow
dbabic
2013/05/29 20:12:26
You are bringing up an interesting issue here. Te
felt
2013/05/29 21:05:36
Sounds good.
In the past, there was an incident w
|
+} |
+ |
+ActivityLogPolicy::~ActivityLogPolicy() { |
+ SaveState(); |
+} |
+ |
+void ActivityLogPolicy::SetSaveStateOnRequestOnly() { |
+ timer_.Stop(); |
+} |
+ |
+void ActivityLogPolicy::GetKey(KeyType, std::string& key) const { |
+ key = ""; |
+} |
+ |
+} // End of the extensions namespace |