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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 #include "chrome/browser/ssl/ssl_tab_helper.h" 72 #include "chrome/browser/ssl/ssl_tab_helper.h"
73 #include "chrome/browser/tab_contents/tab_util.h" 73 #include "chrome/browser/tab_contents/tab_util.h"
74 #include "chrome/browser/toolkit_extra_parts.h" 74 #include "chrome/browser/toolkit_extra_parts.h"
75 #include "chrome/browser/ui/chrome_select_file_policy.h" 75 #include "chrome/browser/ui/chrome_select_file_policy.h"
76 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" 76 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h"
77 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" 77 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
78 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" 78 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h"
79 #include "chrome/browser/user_style_sheet_watcher.h" 79 #include "chrome/browser/user_style_sheet_watcher.h"
80 #include "chrome/browser/user_style_sheet_watcher_factory.h" 80 #include "chrome/browser/user_style_sheet_watcher_factory.h"
81 #include "chrome/browser/validation_message_message_filter.h" 81 #include "chrome/browser/validation_message_message_filter.h"
82 #include "chrome/browser/webrtc_log_upload_manager.h"
82 #include "chrome/common/child_process_logging.h" 83 #include "chrome/common/child_process_logging.h"
83 #include "chrome/common/chrome_constants.h" 84 #include "chrome/common/chrome_constants.h"
84 #include "chrome/common/chrome_paths.h" 85 #include "chrome/common/chrome_paths.h"
85 #include "chrome/common/chrome_process_type.h" 86 #include "chrome/common/chrome_process_type.h"
86 #include "chrome/common/chrome_switches.h" 87 #include "chrome/common/chrome_switches.h"
87 #include "chrome/common/extensions/background_info.h" 88 #include "chrome/common/extensions/background_info.h"
88 #include "chrome/common/extensions/extension.h" 89 #include "chrome/common/extensions/extension.h"
89 #include "chrome/common/extensions/extension_process_policy.h" 90 #include "chrome/common/extensions/extension_process_policy.h"
90 #include "chrome/common/extensions/extension_set.h" 91 #include "chrome/common/extensions/extension_set.h"
91 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h" 92 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h"
(...skipping 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after
2241 2242
2242 #if defined(USE_NSS) 2243 #if defined(USE_NSS)
2243 crypto::CryptoModuleBlockingPasswordDelegate* 2244 crypto::CryptoModuleBlockingPasswordDelegate*
2244 ChromeContentBrowserClient::GetCryptoPasswordDelegate( 2245 ChromeContentBrowserClient::GetCryptoPasswordDelegate(
2245 const GURL& url) { 2246 const GURL& url) {
2246 return chrome::NewCryptoModuleBlockingDialogDelegate( 2247 return chrome::NewCryptoModuleBlockingDialogDelegate(
2247 chrome::kCryptoModulePasswordKeygen, url.host()); 2248 chrome::kCryptoModulePasswordKeygen, url.host());
2248 } 2249 }
2249 #endif 2250 #endif
2250 2251
2252 base::PlatformFile ChromeContentBrowserClient::CreateWebRtcLogFile() {
2253 // TODO(grunell): This should be done by the upload manager. What thread? FILE
2254 // presubmably.
2255 const char filename[] = "/tmp/chromium-webrtc-log-temp.bz2";
2256 int flags = base::PLATFORM_FILE_CREATE_ALWAYS |
2257 base::PLATFORM_FILE_WRITE |
2258 // Temp read here.
2259 base::PLATFORM_FILE_READ;
2260 /*base::PLATFORM_FILE_DELETE_ON_CLOSE*/;
2261 bool created = false;
2262 base::PlatformFileError error = base::PLATFORM_FILE_OK;
2263 base::PlatformFile file =
2264 CreatePlatformFile(base::FilePath(filename), flags, &created, &error);
2265 DCHECK(created);
2266 DCHECK(error == base::PLATFORM_FILE_OK);
2267
2268 return file;
2269 }
2270
2271 void ChromeContentBrowserClient::UploadWebRtcLog(base::PlatformFile log_file) {
2272 WebRtcLogUploadManager* upload_manager =
2273 g_browser_process->webrtc_log_upload_manager();
2274
2275 BrowserThread::PostTask(
2276 BrowserThread::FILE,
2277 FROM_HERE,
2278 base::Bind(&WebRtcLogUploadManager::UploadLog,
2279 base::Unretained(upload_manager),
2280 log_file));
2281 }
2282
2251 } // namespace chrome 2283 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698