1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/media/webrtc_log_list.h"
7 #include "base/files/file.h"
8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h"
10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/common/chrome_paths.h"
12 #include "content/public/browser/browser_thread.h"
16 const char kWebRtcLogDirectory
[] = "WebRTC Logs";
17 const char kWebRtcLogListFilename
[] = "Log List";
22 UploadList
* WebRtcLogList::CreateWebRtcLogList(UploadList::Delegate
* delegate
,
24 base::FilePath log_list_path
= GetWebRtcLogListFileForDirectory(
25 GetWebRtcLogDirectoryForProfile(profile
->GetPath()));
26 return new UploadList(
27 delegate
, log_list_path
, content::BrowserThread::GetBlockingPool());
31 base::FilePath
WebRtcLogList::GetWebRtcLogDirectoryForProfile(
32 const base::FilePath
& profile_path
) {
33 DCHECK(!profile_path
.empty());
34 return profile_path
.AppendASCII(kWebRtcLogDirectory
);
38 base::FilePath
WebRtcLogList::GetWebRtcLogListFileForDirectory(
39 const base::FilePath
& dir
) {
41 return dir
.AppendASCII(kWebRtcLogListFilename
);