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

Unified Diff: content/browser/webrtc_log_manager.h

Issue 14329020: Implementing uploading of a WebRTC diagnostic log. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed pre-submit warnings/errors (including adding bzip2 to content/browser DEPS). Created 7 years, 8 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: 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_

Powered by Google App Engine
This is Rietveld 408576698