OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CONTENT_BROWSER_RENDERER_HOST_WEBRTC_LOGGING_HANDLER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_WEBRTC_LOGGING_HANDLER_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_WEBRTC_LOGGING_HANDLER_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_WEBRTC_LOGGING_HANDLER_HOST_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/shared_memory.h" | 9 #include "base/platform_file.h" |
10 #include "content/public/browser/browser_message_filter.h" | 10 #include "content/public/browser/browser_message_filter.h" |
11 | 11 |
| 12 namespace base { |
| 13 class SharedMemory; |
| 14 } |
| 15 |
12 namespace content { | 16 namespace content { |
13 | 17 |
14 // WebRtcLoggingHandlerHost handles operations regarding the WebRTC logging: | 18 // WebRtcLoggingHandlerHost handles operations regarding the WebRTC logging: |
15 // opening and closing shared memory buffer that the handler in the renderer | 19 // opening and closing shared memory buffer that the handler in the renderer |
16 // process writes to. | 20 // process writes to. |
17 class WebRtcLoggingHandlerHost : public BrowserMessageFilter { | 21 class WebRtcLoggingHandlerHost : public BrowserMessageFilter { |
18 public: | 22 public: |
19 WebRtcLoggingHandlerHost(); | 23 WebRtcLoggingHandlerHost(); |
20 | 24 |
21 private: | 25 private: |
| 26 virtual ~WebRtcLoggingHandlerHost(); |
| 27 |
22 // BrowserMessageFilter implementation. | 28 // BrowserMessageFilter implementation. |
23 virtual void OnChannelClosing() OVERRIDE; | 29 virtual void OnChannelClosing() OVERRIDE; |
24 virtual void OnDestruct() const OVERRIDE; | 30 virtual void OnDestruct() const OVERRIDE; |
25 virtual bool OnMessageReceived(const IPC::Message& message, | 31 virtual bool OnMessageReceived(const IPC::Message& message, |
26 bool* message_was_ok) OVERRIDE; | 32 bool* message_was_ok) OVERRIDE; |
27 | 33 |
28 friend class BrowserThread; | 34 friend class BrowserThread; |
29 friend class base::DeleteHelper<WebRtcLoggingHandlerHost>; | 35 friend class base::DeleteHelper<WebRtcLoggingHandlerHost>; |
30 | 36 |
31 virtual ~WebRtcLoggingHandlerHost(); | |
32 | |
33 void OnOpenLog(); | 37 void OnOpenLog(); |
34 | 38 |
35 base::SharedMemory shared_memory_; | 39 void CreateWebRtcLogFile(); |
| 40 void FinishOpenLog(); |
| 41 |
| 42 bool IsUploadingEnabled(); |
| 43 void UploadLog(); |
| 44 |
| 45 base::SharedMemory* shared_memory_; |
| 46 base::PlatformFile log_file_compressed_; |
36 | 47 |
37 DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost); | 48 DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost); |
38 }; | 49 }; |
39 | 50 |
40 } // namespace content | 51 } // namespace content |
41 | 52 |
42 #endif // CONTENT_BROWSER_RENDERER_HOST_WEBRTC_LOGGING_HANDLER_HOST_H_ | 53 #endif // CONTENT_BROWSER_RENDERER_HOST_WEBRTC_LOGGING_HANDLER_HOST_H_ |
OLD | NEW |