Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(652)

Unified Diff: components/device_event_log/device_event_log_impl.h

Issue 1140643002: Fix device_event_log component build, make NonThreadSafe (Take 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};
« no previous file with comments | « components/device_event_log/device_event_log_export.h ('k') | components/device_event_log/device_event_log_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698