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

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: Added unittest for adding more PeerConnections than the maximum limit. Created 4 years, 6 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..e5f6d49ca9f9f4ee45784d6f7630c8df24d0b9f1 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) {
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);
@@ -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