| 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_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/shared_memory.h" | |
| 10 #include "content/public/browser/browser_message_filter.h" | 9 #include "content/public/browser/browser_message_filter.h" |
| 11 | 10 |
| 11 namespace base { |
| 12 class SharedMemory; |
| 13 } |
| 14 |
| 12 namespace content { | 15 namespace content { |
| 13 | 16 |
| 14 // WebRtcLoggingHandlerHost handles operations regarding the WebRTC logging: | 17 // WebRtcLoggingHandlerHost handles operations regarding the WebRTC logging: |
| 15 // opening and closing shared memory buffer that the handler in the renderer | 18 // - Opens a shared memory buffer that the handler in the render process |
| 16 // process writes to. | 19 // writes to. |
| 20 // - Detects when channel, i.e. renderer, is going away and triggers uploading |
| 21 // the log. |
| 17 class WebRtcLoggingHandlerHost : public BrowserMessageFilter { | 22 class WebRtcLoggingHandlerHost : public BrowserMessageFilter { |
| 18 public: | 23 public: |
| 19 WebRtcLoggingHandlerHost(); | 24 WebRtcLoggingHandlerHost(); |
| 20 | 25 |
| 21 private: | 26 private: |
| 27 virtual ~WebRtcLoggingHandlerHost(); |
| 28 |
| 22 // BrowserMessageFilter implementation. | 29 // BrowserMessageFilter implementation. |
| 23 virtual void OnChannelClosing() OVERRIDE; | 30 virtual void OnChannelClosing() OVERRIDE; |
| 24 virtual void OnDestruct() const OVERRIDE; | 31 virtual void OnDestruct() const OVERRIDE; |
| 25 virtual bool OnMessageReceived(const IPC::Message& message, | 32 virtual bool OnMessageReceived(const IPC::Message& message, |
| 26 bool* message_was_ok) OVERRIDE; | 33 bool* message_was_ok) OVERRIDE; |
| 27 | 34 |
| 28 friend class BrowserThread; | 35 friend class BrowserThread; |
| 29 friend class base::DeleteHelper<WebRtcLoggingHandlerHost>; | 36 friend class base::DeleteHelper<WebRtcLoggingHandlerHost>; |
| 30 | 37 |
| 31 virtual ~WebRtcLoggingHandlerHost(); | |
| 32 | |
| 33 void OnOpenLog(); | 38 void OnOpenLog(); |
| 34 | 39 |
| 35 base::SharedMemory shared_memory_; | 40 void CheckLoggingAllowed(); |
| 41 void DoOpenLog(); |
| 42 |
| 43 void UploadLog(); |
| 44 |
| 45 scoped_ptr<base::SharedMemory> shared_memory_; |
| 36 | 46 |
| 37 DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost); | 47 DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost); |
| 38 }; | 48 }; |
| 39 | 49 |
| 40 } // namespace content | 50 } // namespace content |
| 41 | 51 |
| 42 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ | 52 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ |
| OLD | NEW |