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 CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 class ExtensionRegistry; | 31 class ExtensionRegistry; |
32 | 32 |
33 // Tracked log files. | 33 // Tracked log files. |
34 class FileResource : public ApiResource { | 34 class FileResource : public ApiResource { |
35 public: | 35 public: |
36 FileResource(const std::string& owner_extension_id, | 36 FileResource(const std::string& owner_extension_id, |
37 const base::FilePath& path); | 37 const base::FilePath& path); |
38 virtual ~FileResource(); | 38 virtual ~FileResource(); |
39 | 39 |
40 // ApiResource overrides. | 40 // ApiResource overrides. |
41 virtual bool IsPersistent() const OVERRIDE; | 41 virtual bool IsPersistent() const override; |
42 | 42 |
43 static const char kSequenceToken[]; | 43 static const char kSequenceToken[]; |
44 static const base::SequencedWorkerPool::WorkerShutdown kShutdownBehavior = | 44 static const base::SequencedWorkerPool::WorkerShutdown kShutdownBehavior = |
45 base::SequencedWorkerPool::BLOCK_SHUTDOWN; | 45 base::SequencedWorkerPool::BLOCK_SHUTDOWN; |
46 | 46 |
47 private: | 47 private: |
48 base::FilePath path_; | 48 base::FilePath path_; |
49 | 49 |
50 DISALLOW_COPY_AND_ASSIGN(FileResource); | 50 DISALLOW_COPY_AND_ASSIGN(FileResource); |
51 }; | 51 }; |
(...skipping 22 matching lines...) Expand all Loading... |
74 static BrowserContextKeyedAPIFactory<LogPrivateAPI>* GetFactoryInstance(); | 74 static BrowserContextKeyedAPIFactory<LogPrivateAPI>* GetFactoryInstance(); |
75 | 75 |
76 private: | 76 private: |
77 friend class BrowserContextKeyedAPIFactory<LogPrivateAPI>; | 77 friend class BrowserContextKeyedAPIFactory<LogPrivateAPI>; |
78 | 78 |
79 void Initialize(); | 79 void Initialize(); |
80 // ExtensionRegistryObserver implementation. | 80 // ExtensionRegistryObserver implementation. |
81 virtual void OnExtensionUnloaded( | 81 virtual void OnExtensionUnloaded( |
82 content::BrowserContext* browser_context, | 82 content::BrowserContext* browser_context, |
83 const Extension* extension, | 83 const Extension* extension, |
84 UnloadedExtensionInfo::Reason reason) OVERRIDE; | 84 UnloadedExtensionInfo::Reason reason) override; |
85 | 85 |
86 // ChromeNetLog::ThreadSafeObserver implementation: | 86 // ChromeNetLog::ThreadSafeObserver implementation: |
87 virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE; | 87 virtual void OnAddEntry(const net::NetLog::Entry& entry) override; |
88 | 88 |
89 void PostPendingEntries(); | 89 void PostPendingEntries(); |
90 void AddEntriesOnUI(scoped_ptr<base::ListValue> value); | 90 void AddEntriesOnUI(scoped_ptr<base::ListValue> value); |
91 | 91 |
92 // Initializes a new instance of net::NetLogLogger and passes it back via | 92 // Initializes a new instance of net::NetLogLogger and passes it back via |
93 // |net_logger| param. | 93 // |net_logger| param. |
94 void InitializeNetLogger(const std::string& owner_extension_id, | 94 void InitializeNetLogger(const std::string& owner_extension_id, |
95 net::NetLogLogger** net_logger); | 95 net::NetLogLogger** net_logger); |
96 | 96 |
97 // Starts observing network events with a new |net_logger| instance. | 97 // Starts observing network events with a new |net_logger| instance. |
(...skipping 29 matching lines...) Expand all Loading... |
127 }; | 127 }; |
128 | 128 |
129 class LogPrivateGetHistoricalFunction : public AsyncExtensionFunction { | 129 class LogPrivateGetHistoricalFunction : public AsyncExtensionFunction { |
130 public: | 130 public: |
131 LogPrivateGetHistoricalFunction(); | 131 LogPrivateGetHistoricalFunction(); |
132 DECLARE_EXTENSION_FUNCTION("logPrivate.getHistorical", | 132 DECLARE_EXTENSION_FUNCTION("logPrivate.getHistorical", |
133 LOGPRIVATE_GETHISTORICAL); | 133 LOGPRIVATE_GETHISTORICAL); |
134 | 134 |
135 protected: | 135 protected: |
136 virtual ~LogPrivateGetHistoricalFunction(); | 136 virtual ~LogPrivateGetHistoricalFunction(); |
137 virtual bool RunAsync() OVERRIDE; | 137 virtual bool RunAsync() override; |
138 | 138 |
139 private: | 139 private: |
140 void OnSystemLogsLoaded(scoped_ptr<system_logs::SystemLogsResponse> sys_info); | 140 void OnSystemLogsLoaded(scoped_ptr<system_logs::SystemLogsResponse> sys_info); |
141 | 141 |
142 scoped_ptr<FilterHandler> filter_handler_; | 142 scoped_ptr<FilterHandler> filter_handler_; |
143 | 143 |
144 DISALLOW_COPY_AND_ASSIGN(LogPrivateGetHistoricalFunction); | 144 DISALLOW_COPY_AND_ASSIGN(LogPrivateGetHistoricalFunction); |
145 }; | 145 }; |
146 | 146 |
147 class LogPrivateStartEventRecorderFunction : public AsyncExtensionFunction { | 147 class LogPrivateStartEventRecorderFunction : public AsyncExtensionFunction { |
148 public: | 148 public: |
149 LogPrivateStartEventRecorderFunction(); | 149 LogPrivateStartEventRecorderFunction(); |
150 DECLARE_EXTENSION_FUNCTION("logPrivate.startEventRecorder", | 150 DECLARE_EXTENSION_FUNCTION("logPrivate.startEventRecorder", |
151 LOGPRIVATE_STARTEVENTRECODER); | 151 LOGPRIVATE_STARTEVENTRECODER); |
152 | 152 |
153 protected: | 153 protected: |
154 virtual ~LogPrivateStartEventRecorderFunction(); | 154 virtual ~LogPrivateStartEventRecorderFunction(); |
155 virtual bool RunAsync() OVERRIDE; | 155 virtual bool RunAsync() override; |
156 | 156 |
157 private: | 157 private: |
158 void OnEventRecorderStarted(); | 158 void OnEventRecorderStarted(); |
159 | 159 |
160 DISALLOW_COPY_AND_ASSIGN(LogPrivateStartEventRecorderFunction); | 160 DISALLOW_COPY_AND_ASSIGN(LogPrivateStartEventRecorderFunction); |
161 }; | 161 }; |
162 | 162 |
163 class LogPrivateStopEventRecorderFunction : public AsyncExtensionFunction { | 163 class LogPrivateStopEventRecorderFunction : public AsyncExtensionFunction { |
164 public: | 164 public: |
165 LogPrivateStopEventRecorderFunction(); | 165 LogPrivateStopEventRecorderFunction(); |
166 DECLARE_EXTENSION_FUNCTION("logPrivate.stopEventRecorder", | 166 DECLARE_EXTENSION_FUNCTION("logPrivate.stopEventRecorder", |
167 LOGPRIVATE_STOPEVENTRECODER); | 167 LOGPRIVATE_STOPEVENTRECODER); |
168 | 168 |
169 protected: | 169 protected: |
170 virtual ~LogPrivateStopEventRecorderFunction(); | 170 virtual ~LogPrivateStopEventRecorderFunction(); |
171 | 171 |
172 // AsyncExtensionFunction overrides. | 172 // AsyncExtensionFunction overrides. |
173 virtual bool RunAsync() OVERRIDE; | 173 virtual bool RunAsync() override; |
174 | 174 |
175 private: | 175 private: |
176 void OnEventRecorderStopped(); | 176 void OnEventRecorderStopped(); |
177 | 177 |
178 DISALLOW_COPY_AND_ASSIGN(LogPrivateStopEventRecorderFunction); | 178 DISALLOW_COPY_AND_ASSIGN(LogPrivateStopEventRecorderFunction); |
179 }; | 179 }; |
180 | 180 |
181 class LogPrivateDumpLogsFunction : public AsyncExtensionFunction { | 181 class LogPrivateDumpLogsFunction : public AsyncExtensionFunction { |
182 public: | 182 public: |
183 LogPrivateDumpLogsFunction(); | 183 LogPrivateDumpLogsFunction(); |
184 DECLARE_EXTENSION_FUNCTION("logPrivate.dumpLogs", LOGPRIVATE_DUMPLOGS); | 184 DECLARE_EXTENSION_FUNCTION("logPrivate.dumpLogs", LOGPRIVATE_DUMPLOGS); |
185 | 185 |
186 protected: | 186 protected: |
187 virtual ~LogPrivateDumpLogsFunction(); | 187 virtual ~LogPrivateDumpLogsFunction(); |
188 | 188 |
189 // AsyncExtensionFunction overrides. | 189 // AsyncExtensionFunction overrides. |
190 virtual bool RunAsync() OVERRIDE; | 190 virtual bool RunAsync() override; |
191 | 191 |
192 private: | 192 private: |
193 // Callback for DebugLogWriter::StoreLogs() call. | 193 // Callback for DebugLogWriter::StoreLogs() call. |
194 void OnStoreLogsCompleted(const base::FilePath& log_path, bool succeeded); | 194 void OnStoreLogsCompleted(const base::FilePath& log_path, bool succeeded); |
195 // Callback for LogPrivateAPI::StopAllWatches() call. | 195 // Callback for LogPrivateAPI::StopAllWatches() call. |
196 void OnStopAllWatches(); | 196 void OnStopAllWatches(); |
197 DISALLOW_COPY_AND_ASSIGN(LogPrivateDumpLogsFunction); | 197 DISALLOW_COPY_AND_ASSIGN(LogPrivateDumpLogsFunction); |
198 }; | 198 }; |
199 | 199 |
200 } // namespace extensions | 200 } // namespace extensions |
201 | 201 |
202 #endif // CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_ | 202 #endif // CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PRIVATE_API_H_ |
OLD | NEW |