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

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: Upload again (error last upload). 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 "chromeos/chromeos_constants.h" 101 #include "chromeos/chromeos_constants.h"
102 #include "components/user_prefs/pref_registry_syncable.h" 102 #include "components/user_prefs/pref_registry_syncable.h"
103 #include "components/webrtc_log_uploader/webrtc_log_uploader.h"
103 #include "content/public/browser/browser_child_process_host.h" 104 #include "content/public/browser/browser_child_process_host.h"
104 #include "content/public/browser/browser_main_parts.h" 105 #include "content/public/browser/browser_main_parts.h"
105 #include "content/public/browser/browser_ppapi_host.h" 106 #include "content/public/browser/browser_ppapi_host.h"
107 #include "content/public/browser/browser_thread.h"
106 #include "content/public/browser/browser_url_handler.h" 108 #include "content/public/browser/browser_url_handler.h"
107 #include "content/public/browser/child_process_data.h" 109 #include "content/public/browser/child_process_data.h"
108 #include "content/public/browser/child_process_security_policy.h" 110 #include "content/public/browser/child_process_security_policy.h"
109 #include "content/public/browser/compositor_util.h" 111 #include "content/public/browser/compositor_util.h"
110 #include "content/public/browser/render_process_host.h" 112 #include "content/public/browser/render_process_host.h"
111 #include "content/public/browser/render_view_host.h" 113 #include "content/public/browser/render_view_host.h"
112 #include "content/public/browser/resource_context.h" 114 #include "content/public/browser/resource_context.h"
113 #include "content/public/browser/site_instance.h" 115 #include "content/public/browser/site_instance.h"
114 #include "content/public/browser/web_contents.h" 116 #include "content/public/browser/web_contents.h"
115 #include "content/public/browser/web_contents_view.h" 117 #include "content/public/browser/web_contents_view.h"
(...skipping 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after
2313 2315
2314 #if defined(USE_NSS) 2316 #if defined(USE_NSS)
2315 crypto::CryptoModuleBlockingPasswordDelegate* 2317 crypto::CryptoModuleBlockingPasswordDelegate*
2316 ChromeContentBrowserClient::GetCryptoPasswordDelegate( 2318 ChromeContentBrowserClient::GetCryptoPasswordDelegate(
2317 const GURL& url) { 2319 const GURL& url) {
2318 return chrome::NewCryptoModuleBlockingDialogDelegate( 2320 return chrome::NewCryptoModuleBlockingDialogDelegate(
2319 chrome::kCryptoModulePasswordKeygen, url.host()); 2321 chrome::kCryptoModulePasswordKeygen, url.host());
2320 } 2322 }
2321 #endif 2323 #endif
2322 2324
2325 bool ChromeContentBrowserClient::IsWebRtcLoggingAllowed() {
2326 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
2327
2328 bool enabled = false;
2329
2330 // If the user permits metrics reporting / crash uploading with the checkbox
2331 // in the prefs, we allow uploading automatically. We disable uploading
2332 // completely for non-official builds. This can be forced with a flag.
2333 const CommandLine* command_line = CommandLine::ForCurrentProcess();
2334 if (command_line->HasSwitch(switches::kEnableMetricsReportingForTesting)) {
2335 enabled = true;
2336 } else {
2337 #if defined(GOOGLE_CHROME_BUILD)
2338 #if defined(OS_CHROMEOS)
2339 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref,
2340 &enabled);
2341 #else
2342 enabled = g_browser_process->local_state()->GetBoolean(
2343 prefs::kMetricsReportingEnabled);
2344 #endif // #if defined(OS_CHROMEOS)
2345 #endif // defined(GOOGLE_CHROME_BUILD)
2346 }
2347 if (!enabled)
2348 return false;
2349
2350 return g_browser_process->webrtc_log_uploader()->ApplyForStartLogging();
2351 }
2352
2353 void ChromeContentBrowserClient::UploadWebRtcLog(
2354 scoped_ptr<base::SharedMemory> shared_memory, uint32 length) {
2355 g_browser_process->webrtc_log_uploader()->UploadLog(
2356 shared_memory.Pass(), length);
2357 }
2358
2323 } // namespace chrome 2359 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698