| OLD | NEW |
| 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 #ifndef COMPONENTS_SYNC_BASE_EXTENSIONS_ACTIVITY_H_ | 5 #ifndef COMPONENTS_SYNC_BASE_EXTENSIONS_ACTIVITY_H_ |
| 6 #define COMPONENTS_SYNC_BASE_EXTENSIONS_ACTIVITY_H_ | 6 #define COMPONENTS_SYNC_BASE_EXTENSIONS_ACTIVITY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
| 15 #include "components/sync/base/sync_export.h" | |
| 16 | 15 |
| 17 namespace syncer { | 16 namespace syncer { |
| 18 | 17 |
| 19 // A storage to record usage of extensions APIs to send to sync | 18 // A storage to record usage of extensions APIs to send to sync |
| 20 // servers, with the ability to purge data once sync servers have | 19 // servers, with the ability to purge data once sync servers have |
| 21 // acknowledged it (successful commit response). | 20 // acknowledged it (successful commit response). |
| 22 class SYNC_EXPORT ExtensionsActivity | 21 class ExtensionsActivity |
| 23 : public base::RefCountedThreadSafe<ExtensionsActivity> { | 22 : public base::RefCountedThreadSafe<ExtensionsActivity> { |
| 24 public: | 23 public: |
| 25 // A data record of activity performed by extension |extension_id|. | 24 // A data record of activity performed by extension |extension_id|. |
| 26 struct SYNC_EXPORT Record { | 25 struct Record { |
| 27 Record(); | 26 Record(); |
| 28 ~Record(); | 27 ~Record(); |
| 29 | 28 |
| 30 // The human-readable ID identifying the extension responsible | 29 // The human-readable ID identifying the extension responsible |
| 31 // for the activity reported in this Record. | 30 // for the activity reported in this Record. |
| 32 std::string extension_id; | 31 std::string extension_id; |
| 33 | 32 |
| 34 // How many times the extension successfully invoked a write | 33 // How many times the extension successfully invoked a write |
| 35 // operation through the bookmarks API since the last CommitMessage. | 34 // operation through the bookmarks API since the last CommitMessage. |
| 36 uint32_t bookmark_write_count; | 35 uint32_t bookmark_write_count; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 56 friend class base::RefCountedThreadSafe<ExtensionsActivity>; | 55 friend class base::RefCountedThreadSafe<ExtensionsActivity>; |
| 57 ~ExtensionsActivity(); | 56 ~ExtensionsActivity(); |
| 58 | 57 |
| 59 Records records_; | 58 Records records_; |
| 60 mutable base::Lock records_lock_; | 59 mutable base::Lock records_lock_; |
| 61 }; | 60 }; |
| 62 | 61 |
| 63 } // namespace syncer | 62 } // namespace syncer |
| 64 | 63 |
| 65 #endif // COMPONENTS_SYNC_BASE_EXTENSIONS_ACTIVITY_H_ | 64 #endif // COMPONENTS_SYNC_BASE_EXTENSIONS_ACTIVITY_H_ |
| OLD | NEW |