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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 14329020: Implementing uploading of a WebRTC diagnostic log. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed pre-submit warnings/errors (including adding bzip2 to content/browser DEPS). Created 7 years, 8 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/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index a9c255b818839023ea63c7eefa127525cf2e8cb5..2c167134dfc11f3d32a28ad2cd38612b8e3f422b 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -79,6 +79,7 @@
#include "chrome/browser/user_style_sheet_watcher.h"
#include "chrome/browser/user_style_sheet_watcher_factory.h"
#include "chrome/browser/validation_message_message_filter.h"
+#include "chrome/browser/webrtc_log_upload_manager.h"
#include "chrome/common/child_process_logging.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
@@ -2248,4 +2249,35 @@ crypto::CryptoModuleBlockingPasswordDelegate*
}
#endif
+base::PlatformFile ChromeContentBrowserClient::CreateWebRtcLogFile() {
+ // TODO(grunell): This should be done by the upload manager. What thread? FILE
+ // presubmably.
+ const char filename[] = "/tmp/chromium-webrtc-log-temp.bz2";
+ int flags = base::PLATFORM_FILE_CREATE_ALWAYS |
+ base::PLATFORM_FILE_WRITE |
+ // Temp read here.
+ base::PLATFORM_FILE_READ;
+ /*base::PLATFORM_FILE_DELETE_ON_CLOSE*/;
+ bool created = false;
+ base::PlatformFileError error = base::PLATFORM_FILE_OK;
+ base::PlatformFile file =
+ CreatePlatformFile(base::FilePath(filename), flags, &created, &error);
+ DCHECK(created);
+ DCHECK(error == base::PLATFORM_FILE_OK);
+
+ return file;
+}
+
+void ChromeContentBrowserClient::UploadWebRtcLog(base::PlatformFile log_file) {
+ WebRtcLogUploadManager* upload_manager =
+ g_browser_process->webrtc_log_upload_manager();
+
+ BrowserThread::PostTask(
+ BrowserThread::FILE,
+ FROM_HERE,
+ base::Bind(&WebRtcLogUploadManager::UploadLog,
+ base::Unretained(upload_manager),
+ log_file));
+}
+
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698