OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
Jói
2013/05/24 21:14:06
Looks like this file still needs to be rebased aga
Henrik Grunell
2013/05/27 13:00:32
Yes, now when it's been decided we'll move them, I
| |
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 } // namespace base | |
14 | |
12 namespace content { | 15 namespace content { |
13 | 16 |
17 class RenderProcessHost; | |
18 | |
14 // WebRtcLoggingHandlerHost handles operations regarding the WebRTC logging: | 19 // WebRtcLoggingHandlerHost handles operations regarding the WebRTC logging: |
15 // opening and closing shared memory buffer that the handler in the renderer | 20 // - Opens a shared memory buffer that the handler in the render process |
16 // process writes to. | 21 // writes to. |
22 // - Detects when channel, i.e. renderer, is going away and triggers uploading | |
23 // the log. | |
17 class WebRtcLoggingHandlerHost : public BrowserMessageFilter { | 24 class WebRtcLoggingHandlerHost : public BrowserMessageFilter { |
18 public: | 25 public: |
19 WebRtcLoggingHandlerHost(); | 26 WebRtcLoggingHandlerHost(RenderProcessHost* render_process_host); |
20 | 27 |
21 private: | 28 private: |
29 friend class BrowserThread; | |
30 friend class base::DeleteHelper<WebRtcLoggingHandlerHost>; | |
31 | |
32 virtual ~WebRtcLoggingHandlerHost(); | |
33 | |
22 // BrowserMessageFilter implementation. | 34 // BrowserMessageFilter implementation. |
23 virtual void OnChannelClosing() OVERRIDE; | 35 virtual void OnChannelClosing() OVERRIDE; |
24 virtual void OnDestruct() const OVERRIDE; | 36 virtual void OnDestruct() const OVERRIDE; |
25 virtual bool OnMessageReceived(const IPC::Message& message, | 37 virtual bool OnMessageReceived(const IPC::Message& message, |
26 bool* message_was_ok) OVERRIDE; | 38 bool* message_was_ok) OVERRIDE; |
27 | 39 |
28 friend class BrowserThread; | 40 void OnOpenLog(const std::string& app_session_id, const std::string& app_url) ; |
Jói
2013/05/24 21:14:06
+80
Henrik Grunell
2013/05/27 13:00:32
Done.
| |
29 friend class base::DeleteHelper<WebRtcLoggingHandlerHost>; | |
30 | 41 |
31 virtual ~WebRtcLoggingHandlerHost(); | 42 void OpenLogIfAllowed(); |
43 void DoOpenLog(); | |
32 | 44 |
33 void OnOpenLog(const std::string& app_session_id, const std::string& app_url); | 45 void UploadLog(); |
34 | 46 |
35 base::SharedMemory shared_memory_; | 47 RenderProcessHost* render_process_host_; |
48 scoped_ptr<base::SharedMemory> shared_memory_; | |
36 std::string app_session_id_; | 49 std::string app_session_id_; |
37 std::string app_url_; | 50 std::string app_url_; |
38 | 51 |
39 DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost); | 52 DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost); |
40 }; | 53 }; |
41 | 54 |
42 } // namespace content | 55 } // namespace content |
43 | 56 |
44 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ | 57 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ |
OLD | NEW |