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

Side by Side Diff: components/drive/event_logger.h

Issue 1408243003: Annotate more functions with _Printf_format_string_ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/sync_file_system/logger.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 COMPONENTS_DRIVE_EVENT_LOGGER_H_ 5 #ifndef COMPONENTS_DRIVE_EVENT_LOGGER_H_
6 #define COMPONENTS_DRIVE_EVENT_LOGGER_H_ 6 #define COMPONENTS_DRIVE_EVENT_LOGGER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 26 matching lines...) Expand all
37 // Creates an event logger that keeps the latest kDefaultHistorySize events. 37 // Creates an event logger that keeps the latest kDefaultHistorySize events.
38 EventLogger(); 38 EventLogger();
39 ~EventLogger(); 39 ~EventLogger();
40 40
41 // Logs a message and its severity. 41 // Logs a message and its severity.
42 // Can be called from any thread as long as the object is alive. 42 // Can be called from any thread as long as the object is alive.
43 void LogRawString(logging::LogSeverity severity, const std::string& what); 43 void LogRawString(logging::LogSeverity severity, const std::string& what);
44 44
45 // Logs a message with formatting. 45 // Logs a message with formatting.
46 // Can be called from any thread as long as the object is alive. 46 // Can be called from any thread as long as the object is alive.
47 void Log(logging::LogSeverity severity, const char* format, ...) 47 void Log(logging::LogSeverity severity,
48 PRINTF_FORMAT(3, 4); 48 _Printf_format_string_ const char* format,
49 ...) PRINTF_FORMAT(3, 4);
49 50
50 // Sets the history size. The existing history is cleared. 51 // Sets the history size. The existing history is cleared.
51 // Can be called from any thread as long as the object is alive. 52 // Can be called from any thread as long as the object is alive.
52 void SetHistorySize(size_t history_size); 53 void SetHistorySize(size_t history_size);
53 54
54 // Gets the list of latest events (the oldest event comes first). 55 // Gets the list of latest events (the oldest event comes first).
55 // Can be called from any thread as long as the object is alive. 56 // Can be called from any thread as long as the object is alive.
56 std::vector<Event> GetHistory(); 57 std::vector<Event> GetHistory();
57 58
58 private: 59 private:
59 std::deque<Event> history_; // guarded by lock_. 60 std::deque<Event> history_; // guarded by lock_.
60 size_t history_size_; // guarded by lock_. 61 size_t history_size_; // guarded by lock_.
61 int next_event_id_; // guarded by lock_. 62 int next_event_id_; // guarded by lock_.
62 base::Lock lock_; 63 base::Lock lock_;
63 64
64 DISALLOW_COPY_AND_ASSIGN(EventLogger); 65 DISALLOW_COPY_AND_ASSIGN(EventLogger);
65 }; 66 };
66 67
67 } // namespace drive 68 } // namespace drive
68 69
69 #endif // COMPONENTS_DRIVE_EVENT_LOGGER_H_ 70 #endif // COMPONENTS_DRIVE_EVENT_LOGGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync_file_system/logger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698