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

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: Removed two files 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 2157 matching lines...) Expand 10 before | Expand all | Expand 10 after
2272 2274
2273 #if defined(USE_NSS) 2275 #if defined(USE_NSS)
2274 crypto::CryptoModuleBlockingPasswordDelegate* 2276 crypto::CryptoModuleBlockingPasswordDelegate*
2275 ChromeContentBrowserClient::GetCryptoPasswordDelegate( 2277 ChromeContentBrowserClient::GetCryptoPasswordDelegate(
2276 const GURL& url) { 2278 const GURL& url) {
2277 return chrome::NewCryptoModuleBlockingDialogDelegate( 2279 return chrome::NewCryptoModuleBlockingDialogDelegate(
2278 chrome::kCryptoModulePasswordKeygen, url.host()); 2280 chrome::kCryptoModulePasswordKeygen, url.host());
2279 } 2281 }
2280 #endif 2282 #endif
2281 2283
2284 bool ChromeContentBrowserClient::IsWebRtcLoggingAllowed() {
2285 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
2286
2287 // If the user permits metrics reporting / crash uploading with the checkbox
2288 // in the prefs, we allow uploading automatically. We disable uploading
2289 // completely for non-official builds. This can be forced with a flag.
2290 const CommandLine* command_line = CommandLine::ForCurrentProcess();
2291 if (command_line->HasSwitch(switches::kEnableMetricsReportingForTesting))
2292 return true;
2293
2294 bool enabled = false;
2295
2296 #if defined(GOOGLE_CHROME_BUILD)
2297 #if defined(OS_CHROMEOS)
2298 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref,
2299 &enabled);
2300 #else
2301 enabled = g_browser_process->local_state()->GetBoolean(
2302 prefs::kMetricsReportingEnabled);
2303 #endif // #if defined(OS_CHROMEOS)
2304 #endif // defined(GOOGLE_CHROME_BUILD)
2305
2306 // TODO(grunell): Limit to max 5 logs open simultaneosly. The uploader can
2307 // keep track of that.
2308
2309 return enabled;
2310 }
2311
2312 void ChromeContentBrowserClient::UploadWebRtcLog(
2313 base::SharedMemory* shared_memory, uint32 length) {
2314 g_browser_process->webrtc_log_uploader()->UploadLog(shared_memory, length);
2315 }
2316
2282 } // namespace chrome 2317 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698