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

Unified Diff: chrome/app/breakpad_win.cc

Issue 27031002: Move checking of configured policy on win to breakpad client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years, 2 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
« no previous file with comments | « no previous file | chrome/app/chrome_breakpad_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/breakpad_win.cc
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc
index 02dfc8357e1cc8dd310bc9dfc96dfa1fc9735b48..65b36e266d3f5002129215aab72d5d8b43c56a4b 100644
--- a/chrome/app/breakpad_win.cc
+++ b/chrome/app/breakpad_win.cc
@@ -33,7 +33,6 @@
#include "components/breakpad/breakpad_client.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/result_codes.h"
-#include "policy/policy_constants.h"
#include "sandbox/win/src/nt_internals.h"
#include "sandbox/win/src/sidestep/preamble_patcher.h"
@@ -215,31 +214,6 @@ void SetPluginPath(const std::wstring& path) {
}
}
-// Determine whether configuration management allows loading the crash reporter.
-// Since the configuration management infrastructure is not initialized at this
-// point, we read the corresponding registry key directly. The return status
-// indicates whether policy data was successfully read. If it is true, |result|
-// contains the value set by policy.
-static bool MetricsReportingControlledByPolicy(bool* result) {
- string16 key_name = UTF8ToUTF16(policy::key::kMetricsReportingEnabled);
- DWORD value = 0;
- base::win::RegKey hklm_policy_key(HKEY_LOCAL_MACHINE,
- policy::kRegistryChromePolicyKey, KEY_READ);
- if (hklm_policy_key.ReadValueDW(key_name.c_str(), &value) == ERROR_SUCCESS) {
- *result = value != 0;
- return true;
- }
-
- base::win::RegKey hkcu_policy_key(HKEY_CURRENT_USER,
- policy::kRegistryChromePolicyKey, KEY_READ);
- if (hkcu_policy_key.ReadValueDW(key_name.c_str(), &value) == ERROR_SUCCESS) {
- *result = value != 0;
- return true;
- }
-
- return false;
-}
-
// Appends the breakpad dump path to |g_custom_entries|.
void SetBreakpadDumpPath() {
DCHECK(g_custom_entries);
@@ -330,7 +304,8 @@ google_breakpad::CustomClientInfo* GetCustomInfo(const std::wstring& exe_path,
// Check whether configuration management controls crash reporting.
bool crash_reporting_enabled = true;
bool controlled_by_policy =
- MetricsReportingControlledByPolicy(&crash_reporting_enabled);
+ breakpad::GetBreakpadClient()->ReportingIsEnforcedByPolicy(
+ &crash_reporting_enabled);
const CommandLine& command = *CommandLine::ForCurrentProcess();
bool use_crash_service =
!controlled_by_policy &&
@@ -652,7 +627,8 @@ static void InitPipeNameEnvVar(bool is_per_user_install) {
// Check whether configuration management controls crash reporting.
bool crash_reporting_enabled = true;
bool controlled_by_policy =
- MetricsReportingControlledByPolicy(&crash_reporting_enabled);
+ breakpad::GetBreakpadClient()->ReportingIsEnforcedByPolicy(
+ &crash_reporting_enabled);
const CommandLine& command = *CommandLine::ForCurrentProcess();
bool use_crash_service =
« no previous file with comments | « no previous file | chrome/app/chrome_breakpad_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698