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

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: Code review. 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 #include "chrome/common/extensions/extension_process_policy.h" 92 #include "chrome/common/extensions/extension_process_policy.h"
93 #include "chrome/common/extensions/extension_set.h" 93 #include "chrome/common/extensions/extension_set.h"
94 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h" 94 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h"
95 #include "chrome/common/extensions/manifest_handlers/shared_module_info.h" 95 #include "chrome/common/extensions/manifest_handlers/shared_module_info.h"
96 #include "chrome/common/extensions/permissions/socket_permission.h" 96 #include "chrome/common/extensions/permissions/socket_permission.h"
97 #include "chrome/common/logging_chrome.h" 97 #include "chrome/common/logging_chrome.h"
98 #include "chrome/common/pref_names.h" 98 #include "chrome/common/pref_names.h"
99 #include "chrome/common/render_messages.h" 99 #include "chrome/common/render_messages.h"
100 #include "chrome/common/url_constants.h" 100 #include "chrome/common/url_constants.h"
101 #include "components/user_prefs/pref_registry_syncable.h" 101 #include "components/user_prefs/pref_registry_syncable.h"
102 #include "components/webrtc_log_uploader/webrtc_log_uploader.h"
102 #include "content/public/browser/browser_child_process_host.h" 103 #include "content/public/browser/browser_child_process_host.h"
103 #include "content/public/browser/browser_main_parts.h" 104 #include "content/public/browser/browser_main_parts.h"
104 #include "content/public/browser/browser_ppapi_host.h" 105 #include "content/public/browser/browser_ppapi_host.h"
106 #include "content/public/browser/browser_thread.h"
105 #include "content/public/browser/browser_url_handler.h" 107 #include "content/public/browser/browser_url_handler.h"
106 #include "content/public/browser/child_process_data.h" 108 #include "content/public/browser/child_process_data.h"
107 #include "content/public/browser/child_process_security_policy.h" 109 #include "content/public/browser/child_process_security_policy.h"
108 #include "content/public/browser/compositor_util.h" 110 #include "content/public/browser/compositor_util.h"
109 #include "content/public/browser/render_process_host.h" 111 #include "content/public/browser/render_process_host.h"
110 #include "content/public/browser/render_view_host.h" 112 #include "content/public/browser/render_view_host.h"
111 #include "content/public/browser/resource_context.h" 113 #include "content/public/browser/resource_context.h"
112 #include "content/public/browser/site_instance.h" 114 #include "content/public/browser/site_instance.h"
113 #include "content/public/browser/web_contents.h" 115 #include "content/public/browser/web_contents.h"
114 #include "content/public/browser/web_contents_view.h" 116 #include "content/public/browser/web_contents_view.h"
(...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after
2287 2289
2288 #if defined(USE_NSS) 2290 #if defined(USE_NSS)
2289 crypto::CryptoModuleBlockingPasswordDelegate* 2291 crypto::CryptoModuleBlockingPasswordDelegate*
2290 ChromeContentBrowserClient::GetCryptoPasswordDelegate( 2292 ChromeContentBrowserClient::GetCryptoPasswordDelegate(
2291 const GURL& url) { 2293 const GURL& url) {
2292 return chrome::NewCryptoModuleBlockingDialogDelegate( 2294 return chrome::NewCryptoModuleBlockingDialogDelegate(
2293 chrome::kCryptoModulePasswordKeygen, url.host()); 2295 chrome::kCryptoModulePasswordKeygen, url.host());
2294 } 2296 }
2295 #endif 2297 #endif
2296 2298
2299 bool ChromeContentBrowserClient::IsWebRtcLoggingAllowed() {
2300 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
2301
2302 bool enabled = false;
2303
2304 // If the user permits metrics reporting / crash uploading with the checkbox
2305 // in the prefs, we allow uploading automatically. We disable uploading
2306 // completely for non-official builds. This can be forced with a flag.
2307 const CommandLine* command_line = CommandLine::ForCurrentProcess();
2308 if (command_line->HasSwitch(switches::kEnableMetricsReportingForTesting)) {
2309 enabled = true;
2310 } else {
2311 #if defined(GOOGLE_CHROME_BUILD)
2312 #if defined(OS_CHROMEOS)
2313 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref,
2314 &enabled);
2315 #else
2316 enabled = g_browser_process->local_state()->GetBoolean(
2317 prefs::kMetricsReportingEnabled);
2318 #endif // #if defined(OS_CHROMEOS)
2319 #endif // defined(GOOGLE_CHROME_BUILD)
2320 }
2321 if (!enabled)
2322 return false;
2323
2324 return g_browser_process->webrtc_log_uploader()->ApplyForStartLogging();
2325 }
2326
2327 void ChromeContentBrowserClient::UploadWebRtcLog(
2328 scoped_ptr<base::SharedMemory> shared_memory, uint32 length) {
2329 g_browser_process->webrtc_log_uploader()->UploadLog(
2330 shared_memory.Pass(), length);
2331 }
2332
2297 } // namespace chrome 2333 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698