| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_API_FEEDBACK_PRIVATE_LOG_SOURCE_ACCESS_MANAGER
_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_LOG_SOURCE_ACCESS_MANAGER
_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_LOG_SOURCE_ACCESS_MANAGER
_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_LOG_SOURCE_ACCESS_MANAGER
_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/time/tick_clock.h" | 16 #include "base/time/tick_clock.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "chrome/browser/feedback/system_logs/system_logs_source.h" | |
| 19 #include "chrome/common/extensions/api/feedback_private.h" | 18 #include "chrome/common/extensions/api/feedback_private.h" |
| 19 #include "components/feedback/system_logs/system_logs_source.h" |
| 20 #include "content/public/browser/browser_context.h" | 20 #include "content/public/browser/browser_context.h" |
| 21 | 21 |
| 22 namespace extensions { | 22 namespace extensions { |
| 23 | 23 |
| 24 // Provides bookkeepping for SingleLogSource usage. It ensures that: | 24 // Provides bookkeepping for SingleLogSource usage. It ensures that: |
| 25 // - Each extension can have only one SingleLogSource for a particular source. | 25 // - Each extension can have only one SingleLogSource for a particular source. |
| 26 // - A source may not be accessed too frequently by an extension. | 26 // - A source may not be accessed too frequently by an extension. |
| 27 class LogSourceAccessManager { | 27 class LogSourceAccessManager { |
| 28 public: | 28 public: |
| 29 using ReadLogSourceCallback = | 29 using ReadLogSourceCallback = |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 std::unique_ptr<base::TickClock> tick_clock_; | 135 std::unique_ptr<base::TickClock> tick_clock_; |
| 136 | 136 |
| 137 base::WeakPtrFactory<LogSourceAccessManager> weak_factory_; | 137 base::WeakPtrFactory<LogSourceAccessManager> weak_factory_; |
| 138 | 138 |
| 139 DISALLOW_COPY_AND_ASSIGN(LogSourceAccessManager); | 139 DISALLOW_COPY_AND_ASSIGN(LogSourceAccessManager); |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 } // namespace extensions | 142 } // namespace extensions |
| 143 | 143 |
| 144 #endif // CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_LOG_SOURCE_ACCESS_MANA
GER_H_ | 144 #endif // CHROME_BROWSER_EXTENSIONS_API_FEEDBACK_PRIVATE_LOG_SOURCE_ACCESS_MANA
GER_H_ |
| OLD | NEW |