Index: content/browser/webrtc_log_manager.h |
diff --git a/content/browser/webrtc_log_manager.h b/content/browser/webrtc_log_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1f0e53bfa12f938df0889c329158f902675ce25c |
--- /dev/null |
+++ b/content/browser/webrtc_log_manager.h |
@@ -0,0 +1,45 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_BROWSER_WEBRTC_LOG_MANAGER_H_ |
+#define CONTENT_BROWSER_WEBRTC_LOG_MANAGER_H_ |
+ |
+#include "base/memory/singleton.h" |
+#include "base/platform_file.h" |
+#include "content/common/content_export.h" |
+ |
+namespace base { |
+class SharedMemory; |
+} |
+ |
+namespace net { |
+class FileStream; |
+} |
+ |
+namespace content { |
+ |
+// This is a singleton class running in the browser FILE thread. |
+// It reads a WebRTC log from a partial circular buffer and compresses it to a |
+// file, then notifies the embedder that the file is ready. |
+class CONTENT_EXPORT WebRtcLogManager { |
+ public: |
+ static WebRtcLogManager* GetInstance(); |
+ |
+ // Takes ownership of |shared_memory|. |
+ void UploadLog(base::SharedMemory* shared_memory, uint32 length, |
+ base::PlatformFile file); |
+ |
+ private: |
+ friend struct DefaultSingletonTraits<WebRtcLogManager>; |
+ |
+ WebRtcLogManager(); |
+ virtual ~WebRtcLogManager(); |
+ |
+ void ReadAndCompressLog(uint8* input, uint32 input_size, |
+ base::PlatformFile output_file); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_WEBRTC_LOG_MANAGER_H_ |