| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 178 |
| 179 // At the moment, ActivityLog will use only one policy for summarization. | 179 // At the moment, ActivityLog will use only one policy for summarization. |
| 180 // These methods are used to choose and set the most appropriate policy. | 180 // These methods are used to choose and set the most appropriate policy. |
| 181 void ChooseDefaultPolicy(); | 181 void ChooseDefaultPolicy(); |
| 182 void SetDefaultPolicy(ActivityLogPolicy::PolicyType policy_type); | 182 void SetDefaultPolicy(ActivityLogPolicy::PolicyType policy_type); |
| 183 | 183 |
| 184 typedef ObserverListThreadSafe<Observer> ObserverList; | 184 typedef ObserverListThreadSafe<Observer> ObserverList; |
| 185 scoped_refptr<ObserverList> observers_; | 185 scoped_refptr<ObserverList> observers_; |
| 186 | 186 |
| 187 // The policy object takes care of data summarization, compression, and | 187 // The policy object takes care of data summarization, compression, and |
| 188 // logging | 188 // logging. The policy object is owned by the ActivityLog, but this cannot |
| 189 // be a scoped_ptr since some cleanup work must happen on the database |
| 190 // thread. Calling policy_->Close() will free the object; see the comments |
| 191 // on the ActivityDatabase class for full details. |
| 189 extensions::ActivityLogPolicy* policy_; | 192 extensions::ActivityLogPolicy* policy_; |
| 190 | 193 |
| 191 // TODO(dbabic,felt) change this into a list of policy types later. | 194 // TODO(dbabic,felt) change this into a list of policy types later. |
| 192 ActivityLogPolicy::PolicyType policy_type_; | 195 ActivityLogPolicy::PolicyType policy_type_; |
| 193 | 196 |
| 194 Profile* profile_; | 197 Profile* profile_; |
| 195 bool enabled_; // Whether logging is currently enabled. | 198 bool enabled_; // Whether logging is currently enabled. |
| 196 bool initialized_; // Whether Init() has already been called. | 199 bool initialized_; // Whether Init() has already been called. |
| 197 bool policy_chosen_; // Whether we've already set the default policy. | 200 bool policy_chosen_; // Whether we've already set the default policy. |
| 198 // testing_mode_ controls whether to log API call arguments. By default, we | 201 // testing_mode_ controls whether to log API call arguments. By default, we |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 virtual content::BrowserContext* GetBrowserContextToUse( | 238 virtual content::BrowserContext* GetBrowserContextToUse( |
| 236 content::BrowserContext* context) const OVERRIDE; | 239 content::BrowserContext* context) const OVERRIDE; |
| 237 | 240 |
| 238 DISALLOW_COPY_AND_ASSIGN(ActivityLogFactory); | 241 DISALLOW_COPY_AND_ASSIGN(ActivityLogFactory); |
| 239 }; | 242 }; |
| 240 | 243 |
| 241 | 244 |
| 242 } // namespace extensions | 245 } // namespace extensions |
| 243 | 246 |
| 244 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_ | 247 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_ |
| OLD | NEW |