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

Side by Side Diff: chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.h

Issue 1650133002: Start and stop RTC event logs from private extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split the logging handler into one for audio recordings and one for event logs Created 4 years, 10 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
OLDNEW
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_WEBRTC_LOGGING_PRIVATE_WEBRTC_LOGGING_PRIV ATE_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEBRTC_LOGGING_PRIVATE_WEBRTC_LOGGING_PRIV ATE_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_WEBRTC_LOGGING_PRIVATE_WEBRTC_LOGGING_PRIV ATE_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_WEBRTC_LOGGING_PRIVATE_WEBRTC_LOGGING_PRIV ATE_API_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "chrome/browser/extensions/chrome_extension_function.h" 10 #include "chrome/browser/extensions/chrome_extension_function.h"
11 #if defined(ENABLE_WEBRTC) 11 #if defined(ENABLE_WEBRTC)
12 #include "chrome/browser/media/audio_debug_recordings_handler.h"
13 #include "chrome/browser/media/rtc_event_log_handler.h"
12 #include "chrome/browser/media/webrtc_logging_handler_host.h" 14 #include "chrome/browser/media/webrtc_logging_handler_host.h"
13 #endif 15 #endif
14 #include "chrome/common/extensions/api/webrtc_logging_private.h" 16 #include "chrome/common/extensions/api/webrtc_logging_private.h"
15 17
16 namespace content { 18 namespace content {
17 19
18 class RenderProcessHost; 20 class RenderProcessHost;
19 21
20 } 22 }
21 23
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 protected: 66 protected:
65 ~WebrtcLoggingPrivateFunctionWithUploadCallback() override {} 67 ~WebrtcLoggingPrivateFunctionWithUploadCallback() override {}
66 68
67 #if defined(ENABLE_WEBRTC) 69 #if defined(ENABLE_WEBRTC)
68 // Must be called on UI thread. 70 // Must be called on UI thread.
69 void FireCallback(bool success, const std::string& report_id, 71 void FireCallback(bool success, const std::string& report_id,
70 const std::string& error_message); 72 const std::string& error_message);
71 #endif 73 #endif
72 }; 74 };
73 75
74 class WebrtcLoggingPrivateFunctionWithAudioDebugRecordingsCallback 76 class WebrtcLoggingPrivateFunctionWithTimeLimitedRecordingCallback
Henrik Grunell 2016/02/23 15:29:10 Drop "TimeLimited".
terelius-chromium 2016/03/02 10:01:09 Done.
75 : public WebrtcLoggingPrivateFunction { 77 : public WebrtcLoggingPrivateFunction {
76 protected: 78 protected:
77 ~WebrtcLoggingPrivateFunctionWithAudioDebugRecordingsCallback() override {} 79 ~WebrtcLoggingPrivateFunctionWithTimeLimitedRecordingCallback() override {}
78 80
79 #if defined(ENABLE_WEBRTC) 81 #if defined(ENABLE_WEBRTC)
80 // Must be called on UI thread. 82 // Must be called on UI thread.
81 void FireErrorCallback(const std::string& error_message); 83 void FireErrorCallback(const std::string& error_message);
82 void FireCallback(const std::string& prefix_path, 84 void FireCallback(const std::string& prefix_path,
83 bool did_stop, 85 bool did_stop,
84 bool did_manual_stop); 86 bool did_manual_stop);
85 #endif 87 #endif
86 }; 88 };
87 89
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 WebrtcLoggingPrivateStopRtpDumpFunction() {} 221 WebrtcLoggingPrivateStopRtpDumpFunction() {}
220 222
221 private: 223 private:
222 ~WebrtcLoggingPrivateStopRtpDumpFunction() override {} 224 ~WebrtcLoggingPrivateStopRtpDumpFunction() override {}
223 225
224 // ExtensionFunction overrides. 226 // ExtensionFunction overrides.
225 bool RunAsync() override; 227 bool RunAsync() override;
226 }; 228 };
227 229
228 class WebrtcLoggingPrivateStartAudioDebugRecordingsFunction 230 class WebrtcLoggingPrivateStartAudioDebugRecordingsFunction
229 : public WebrtcLoggingPrivateFunctionWithAudioDebugRecordingsCallback { 231 : public WebrtcLoggingPrivateFunctionWithTimeLimitedRecordingCallback {
230 public: 232 public:
231 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.startAudioDebugRecordings", 233 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.startAudioDebugRecordings",
232 WEBRTCLOGGINGPRIVATE_STARTAUDIODEBUGRECORDINGS) 234 WEBRTCLOGGINGPRIVATE_STARTAUDIODEBUGRECORDINGS)
233 WebrtcLoggingPrivateStartAudioDebugRecordingsFunction() {} 235 WebrtcLoggingPrivateStartAudioDebugRecordingsFunction() {}
234 236
235 private: 237 private:
236 ~WebrtcLoggingPrivateStartAudioDebugRecordingsFunction() override {} 238 ~WebrtcLoggingPrivateStartAudioDebugRecordingsFunction() override {}
237 239
238 // ExtensionFunction overrides. 240 // ExtensionFunction overrides.
239 bool RunAsync() override; 241 bool RunAsync() override;
240 }; 242 };
241 243
242 class WebrtcLoggingPrivateStopAudioDebugRecordingsFunction 244 class WebrtcLoggingPrivateStopAudioDebugRecordingsFunction
243 : public WebrtcLoggingPrivateFunctionWithAudioDebugRecordingsCallback { 245 : public WebrtcLoggingPrivateFunctionWithTimeLimitedRecordingCallback {
244 public: 246 public:
245 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.stopAudioDebugRecordings", 247 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.stopAudioDebugRecordings",
246 WEBRTCLOGGINGPRIVATE_STOPAUDIODEBUGRECORDINGS) 248 WEBRTCLOGGINGPRIVATE_STOPAUDIODEBUGRECORDINGS)
247 WebrtcLoggingPrivateStopAudioDebugRecordingsFunction() {} 249 WebrtcLoggingPrivateStopAudioDebugRecordingsFunction() {}
248 250
249 private: 251 private:
250 ~WebrtcLoggingPrivateStopAudioDebugRecordingsFunction() override {} 252 ~WebrtcLoggingPrivateStopAudioDebugRecordingsFunction() override {}
251 253
252 // ExtensionFunction overrides. 254 // ExtensionFunction overrides.
253 bool RunAsync() override; 255 bool RunAsync() override;
254 }; 256 };
255 257
258 class WebrtcLoggingPrivateStartRtcEventLoggingFunction
259 : public WebrtcLoggingPrivateFunctionWithTimeLimitedRecordingCallback {
260 public:
261 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.startRtcEventLogging",
262 WEBRTCLOGGINGPRIVATE_STARTRTCEVENTLOGGING)
263 WebrtcLoggingPrivateStartRtcEventLoggingFunction() {}
264
265 private:
266 ~WebrtcLoggingPrivateStartRtcEventLoggingFunction() override {}
267
268 // ExtensionFunction overrides.
269 bool RunAsync() override;
270 };
271
272 class WebrtcLoggingPrivateStopRtcEventLoggingFunction
273 : public WebrtcLoggingPrivateFunctionWithTimeLimitedRecordingCallback {
274 public:
275 DECLARE_EXTENSION_FUNCTION("webrtcLoggingPrivate.stopRtcEventLogging",
276 WEBRTCLOGGINGPRIVATE_STOPRTCEVENTLOGGING)
277 WebrtcLoggingPrivateStopRtcEventLoggingFunction() {}
278
279 private:
280 ~WebrtcLoggingPrivateStopRtcEventLoggingFunction() override {}
281
282 // ExtensionFunction overrides.
283 bool RunAsync() override;
284 };
285
256 } // namespace extensions 286 } // namespace extensions
257 287
258 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBRTC_LOGGING_PRIVATE_WEBRTC_LOGGING_P RIVATE_API_H_ 288 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBRTC_LOGGING_PRIVATE_WEBRTC_LOGGING_P RIVATE_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698