| Index: components/device_event_log/device_event_log_impl.h
|
| diff --git a/components/device_event_log/device_event_log_impl.h b/components/device_event_log/device_event_log_impl.h
|
| index ee33d653337a12dbcd17e04fa0835278f89de060..6c3dffeb726f8ce076424e3f5cd065a467c294d1 100644
|
| --- a/components/device_event_log/device_event_log_impl.h
|
| +++ b/components/device_event_log/device_event_log_impl.h
|
| @@ -8,12 +8,16 @@
|
| #include <list>
|
| #include <string>
|
|
|
| +#include "base/memory/ref_counted.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "base/single_thread_task_runner.h"
|
| #include "base/time/time.h"
|
| #include "components/device_event_log/device_event_log.h"
|
|
|
| namespace device_event_log {
|
|
|
| -class DeviceEventLogImpl {
|
| +// Implementation class for DEVICE_LOG.
|
| +class DEVICE_EVENT_LOG_EXPORT DeviceEventLogImpl {
|
| public:
|
| struct LogEntry {
|
| LogEntry(const char* filedesc,
|
| @@ -31,7 +35,9 @@ class DeviceEventLogImpl {
|
| int count;
|
| };
|
|
|
| - explicit DeviceEventLogImpl(size_t max_entries);
|
| + explicit DeviceEventLogImpl(
|
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner,
|
| + size_t max_entries);
|
| ~DeviceEventLogImpl();
|
|
|
| // Implements device_event_log::AddEntry.
|
| @@ -62,13 +68,16 @@ class DeviceEventLogImpl {
|
| typedef std::list<LogEntry> LogEntryList;
|
|
|
| void AddLogEntry(const LogEntry& entry);
|
| + void RemoveEntry();
|
|
|
| // For testing
|
| size_t max_entries() const { return max_entries_; }
|
| void set_max_entries_for_test(size_t entries) { max_entries_ = entries; }
|
|
|
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
|
| size_t max_entries_;
|
| LogEntryList entries_;
|
| + base::WeakPtrFactory<DeviceEventLogImpl> weak_ptr_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(DeviceEventLogImpl);
|
| };
|
|
|