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

Unified Diff: chrome/browser/media/webrtc_event_log_handler.cc

Issue 1855193002: Move the call to enable the WebRTC event log from PeerConnectionFactory to PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved event log related bookkeeping/IPC from chrome/ to content/, into new class called WebRTCEvent… Created 4 years, 7 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: chrome/browser/media/webrtc_event_log_handler.cc
diff --git a/chrome/browser/media/webrtc_event_log_handler.cc b/chrome/browser/media/webrtc_event_log_handler.cc
index 0d9baccce4be9ff2de0f7586f9bd9508f533285f..6e798604dc7d6e048614973cdb1d83f240f4a746 100644
--- a/chrome/browser/media/webrtc_event_log_handler.cc
+++ b/chrome/browser/media/webrtc_event_log_handler.cc
@@ -31,14 +31,13 @@ base::FilePath GetWebRtcEventLogPrefixPath(const base::FilePath& directory,
uint64_t rtc_event_log_id) {
Henrik Grunell 2016/05/24 13:31:59 Isn't an int enough?
Ivo-OOO until feb 6 2016/05/25 14:57:00 It probably is, but since the current code uses a
static const char kWebRtcEventLogFilePrefix[] = "WebRtcEventLog.";
return directory.AppendASCII(kWebRtcEventLogFilePrefix +
- base::Int64ToString(rtc_event_log_id));
+ base::Uint64ToString(rtc_event_log_id));
}
} // namespace
WebRtcEventLogHandler::WebRtcEventLogHandler(Profile* profile)
: profile_(profile),
- is_rtc_event_logging_in_progress_(false),
current_rtc_event_log_id_(0) {
DCHECK(profile_);
thread_checker_.DetachFromThread();
@@ -94,16 +93,13 @@ void WebRtcEventLogHandler::DoStartWebRtcEventLogging(
const base::FilePath& log_directory) {
DCHECK(thread_checker_.CalledOnValidThread());
- if (is_rtc_event_logging_in_progress_) {
+ base::FilePath prefix_path =
+ GetWebRtcEventLogPrefixPath(log_directory, current_rtc_event_log_id_);
+ if (!host->StartWebRTCEventLog(prefix_path)) {
error_callback.Run("RTC event logging already in progress");
return;
}
- is_rtc_event_logging_in_progress_ = true;
- base::FilePath prefix_path =
- GetWebRtcEventLogPrefixPath(log_directory, ++current_rtc_event_log_id_);
- host->EnableEventLogRecordings(prefix_path);
-
if (delay.is_zero()) {
const bool is_stopped = false, is_manual_stop = false;
callback.Run(prefix_path.AsUTF8Unsafe(), is_stopped, is_manual_stop);
@@ -114,7 +110,7 @@ void WebRtcEventLogHandler::DoStartWebRtcEventLogging(
BrowserThread::PostDelayedTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&WebRtcEventLogHandler::DoStopWebRtcEventLogging, this, host,
- is_manual_stop, current_rtc_event_log_id_, callback,
+ is_manual_stop, ++current_rtc_event_log_id_, callback,
ncarter (slow) 2016/05/20 18:27:20 This ++ doesn't make any sense to me. The paramete
Ivo-OOO until feb 6 2016/05/25 14:57:00 Right, good catch. This ++ is indeed in the wrong
error_callback, log_directory),
delay);
}
@@ -142,13 +138,11 @@ void WebRtcEventLogHandler::DoStopWebRtcEventLogging(
return;
}
- if (!is_rtc_event_logging_in_progress_) {
+ if (!host->StopWebRTCEventLog()) {
error_callback.Run("No RTC event logging in progress");
return;
}
- host->DisableEventLogRecordings();
- is_rtc_event_logging_in_progress_ = false;
const bool is_stopped = true;
callback.Run(prefix_path.AsUTF8Unsafe(), is_stopped, is_manual_stop);
}

Powered by Google App Engine
This is Rietveld 408576698