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

Side by Side Diff: trunk/src/chrome/browser/media/webrtc_logging_handler_host.h

Issue 132233058: Revert 247164 "Implement browser-side logging to WebRtc log" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ 5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_
6 #define CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ 6 #define CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "content/public/browser/browser_message_filter.h" 10 #include "content/public/browser/browser_message_filter.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 void UploadLog(const UploadDoneCallback& callback); 54 void UploadLog(const UploadDoneCallback& callback);
55 55
56 // Called by WebRtcLogUploader when uploading has finished. Must be called on 56 // Called by WebRtcLogUploader when uploading has finished. Must be called on
57 // the IO thread. 57 // the IO thread.
58 void UploadLogDone(); 58 void UploadLogDone();
59 59
60 // Discards the log. May only be called after logging has stopped. Must be 60 // Discards the log. May only be called after logging has stopped. Must be
61 // called on the IO thread. 61 // called on the IO thread.
62 void DiscardLog(const GenericDoneCallback& callback); 62 void DiscardLog(const GenericDoneCallback& callback);
63 63
64 // Adds a message to the log.
65 void LogMessage(const std::string& message);
66
67 // May be called on any thread. |upload_log_on_render_close_| is used 64 // May be called on any thread. |upload_log_on_render_close_| is used
68 // for decision making and it's OK if it changes before the execution based 65 // for decision making and it's OK if it changes before the execution based
69 // on that decision has finished. 66 // on that decision has finished.
70 void set_upload_log_on_render_close(bool should_upload) { 67 void set_upload_log_on_render_close(bool should_upload) {
71 upload_log_on_render_close_ = should_upload; 68 upload_log_on_render_close_ = should_upload;
72 } 69 }
73 70
74 private: 71 private:
75 // States used for protecting from function calls made at non-allowed points 72 // States used for protecting from function calls made at non-allowed points
76 // in time. For example, StartLogging() is only allowed in CLOSED state. 73 // in time. For example, StartLogging() is only allowed in CLOSED state.
(...skipping 18 matching lines...) Expand all
95 friend class base::DeleteHelper<WebRtcLoggingHandlerHost>; 92 friend class base::DeleteHelper<WebRtcLoggingHandlerHost>;
96 93
97 virtual ~WebRtcLoggingHandlerHost(); 94 virtual ~WebRtcLoggingHandlerHost();
98 95
99 // BrowserMessageFilter implementation. 96 // BrowserMessageFilter implementation.
100 virtual void OnChannelClosing() OVERRIDE; 97 virtual void OnChannelClosing() OVERRIDE;
101 virtual void OnDestruct() const OVERRIDE; 98 virtual void OnDestruct() const OVERRIDE;
102 virtual bool OnMessageReceived(const IPC::Message& message, 99 virtual bool OnMessageReceived(const IPC::Message& message,
103 bool* message_was_ok) OVERRIDE; 100 bool* message_was_ok) OVERRIDE;
104 101
105 // Handles log message requests from both renderer process.
106 void OnAddLogMessage(const std::string& message); 102 void OnAddLogMessage(const std::string& message);
107 void OnLoggingStoppedInRenderer(); 103 void OnLoggingStoppedInRenderer();
108 104
109 // Handles log message requests from browser process.
110 void AddLogMessageFromBrowser(const std::string& message);
111
112 void StartLoggingIfAllowed(); 105 void StartLoggingIfAllowed();
113 void DoStartLogging(); 106 void DoStartLogging();
114 void LogMachineInfo(); 107 void LogMachineInfo();
115 void NotifyLoggingStarted(); 108 void NotifyLoggingStarted();
116 109
117 // Writes a formatted log |message| to the |circular_buffer_|. 110 // Writes a formatted log |message| to the |circular_buffer_|.
118 void LogToCircularBuffer(const std::string& message); 111 void LogToCircularBuffer(const std::string& message);
119 112
120 void TriggerUploadLog(); 113 void TriggerUploadLog();
121 114
(...skipping 30 matching lines...) Expand all
152 145
153 // This is the handle to be passed to the render process. It's stored so that 146 // This is the handle to be passed to the render process. It's stored so that
154 // it doesn't have to be passed on when posting messages between threads. 147 // it doesn't have to be passed on when posting messages between threads.
155 // It's only accessed on the IO thread. 148 // It's only accessed on the IO thread.
156 base::SharedMemoryHandle foreign_memory_handle_; 149 base::SharedMemoryHandle foreign_memory_handle_;
157 150
158 DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost); 151 DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost);
159 }; 152 };
160 153
161 #endif // CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ 154 #endif // CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698