summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmoss@chromium.org <mmoss@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-03 19:16:53 +0000
committermmoss@chromium.org <mmoss@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-03 19:16:53 +0000
commit7bbb323426a3d67181d30c31707fca75e59e5272 (patch)
treeaef29f91af25ac253d07b049e2d4b5773a34f46e
parent957f94835069fcd12c9669723210ecf124cf8805 (diff)
downloadchromium_src-7bbb323426a3d67181d30c31707fca75e59e5272.zip
chromium_src-7bbb323426a3d67181d30c31707fca75e59e5272.tar.gz
chromium_src-7bbb323426a3d67181d30c31707fca75e59e5272.tar.bz2
Merge 114022 - Add a policy pref for the --enable-memory-info flag.
BUG=43281 TEST=Setting pref has same effect as running with --enable-memory-info. Review URL: http://codereview.chromium.org/8896018 TBR=mmoss@chromium.org Review URL: http://codereview.chromium.org/9076001 git-svn-id: svn://svn.chromium.org/chrome/branches/963/src@116163 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/policy/policy_templates.json15
-rw-r--r--chrome/browser/policy/configuration_policy_handler_list.cc2
-rw-r--r--chrome/browser/policy/configuration_policy_pref_store_unittest.cc2
-rw-r--r--chrome/browser/prefs/command_line_pref_store.cc1
-rw-r--r--chrome/browser/tab_contents/render_view_host_delegate_helper.cc2
-rw-r--r--chrome/browser/ui/browser.cc3
-rw-r--r--chrome/common/pref_names.cc3
-rw-r--r--chrome/common/pref_names.h1
-rw-r--r--chrome/test/data/enterprise/chrome-reverse.json1
-rw-r--r--chrome/test/data/enterprise/chrome.json1
-rwxr-xr-xchrome/test/functional/policy_prefs_ui.py1
11 files changed, 30 insertions, 2 deletions
diff --git a/chrome/app/policy/policy_templates.json b/chrome/app/policy/policy_templates.json
index d0e3d04..21ed480 100644
--- a/chrome/app/policy/policy_templates.json
+++ b/chrome/app/policy/policy_templates.json
@@ -100,7 +100,7 @@
# persistent IDs for all fields (but not for groups!) are needed. These are
# specified by the 'id' keys of each policy. NEVER CHANGE EXISTING IDs,
# because doing so would break the deployed wire format!
-# For your editing convenience: highest ID currently used: 114
+# For your editing convenience: highest ID currently used: 115
#
# Placeholders:
# The following placeholder strings are automatically substituted:
@@ -2142,6 +2142,19 @@
This setting is used to enable the TLS origin-bound certificates extension for testing. This experimental setting will be removed in the future.''',
},
+ {
+ 'name': 'EnableMemoryInfo',
+ 'type': 'main',
+ 'supported_on': ['chrome.*:16-'],
+ 'features': {'dynamic_refresh': True},
+ 'future': True,
+ 'example_value': False,
+ 'id': 115,
+ 'caption': '''Enable reporting memory info (JS heap size) to page''',
+ 'desc': '''Allows pages to access JavaScript memory usage statistics.
+
+ This settings makes the memory statistics from the Developer Tools Profiles panel available to the web page itself.''',
+ },
],
'messages': {
# Messages that are not associated to any policies.
diff --git a/chrome/browser/policy/configuration_policy_handler_list.cc b/chrome/browser/policy/configuration_policy_handler_list.cc
index 483edba..f8493e5 100644
--- a/chrome/browser/policy/configuration_policy_handler_list.cc
+++ b/chrome/browser/policy/configuration_policy_handler_list.cc
@@ -194,6 +194,8 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = {
prefs::kEnterpriseWebStoreURL },
{ Value::TYPE_STRING, kPolicyEnterpriseWebStoreName,
prefs::kEnterpriseWebStoreName },
+ { Value::TYPE_BOOLEAN, kPolicyEnableMemoryInfo,
+ prefs::kEnableMemoryInfo },
#if defined(OS_CHROMEOS)
{ Value::TYPE_BOOLEAN, kPolicyChromeOsLockOnIdleSuspend,
diff --git a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
index bd29759..c00187e 100644
--- a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
+++ b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
@@ -255,6 +255,8 @@ INSTANTIATE_TEST_CASE_P(
prefs::kImportSearchEngine),
TypeAndName(kPolicyImportSavedPasswords,
prefs::kImportSavedPasswords),
+ TypeAndName(kPolicyEnableMemoryInfo,
+ prefs::kEnableMemoryInfo),
TypeAndName(kPolicyDeveloperToolsDisabled,
prefs::kDevToolsDisabled)));
diff --git a/chrome/browser/prefs/command_line_pref_store.cc b/chrome/browser/prefs/command_line_pref_store.cc
index 306b62c..9b3e41d 100644
--- a/chrome/browser/prefs/command_line_pref_store.cc
+++ b/chrome/browser/prefs/command_line_pref_store.cc
@@ -48,6 +48,7 @@ const CommandLinePrefStore::BooleanSwitchToPreferenceMapEntry
{ switches::kDisableTLS1, prefs::kTLS1Enabled, false },
{ switches::kEnableOriginBoundCerts, prefs::kEnableOriginBoundCerts,
true },
+ { switches::kEnableMemoryInfo, prefs::kEnableMemoryInfo, false },
};
const CommandLinePrefStore::IntegerSwitchToPreferenceMapEntry
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
index 96511c0..069c5a8 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
@@ -471,7 +471,7 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs(
web_prefs.accelerated_video_enabled =
!command_line.HasSwitch(switches::kDisableAcceleratedVideo);
web_prefs.memory_info_enabled =
- command_line.HasSwitch(switches::kEnableMemoryInfo);
+ prefs->GetBoolean(prefs::kEnableMemoryInfo);
web_prefs.interactive_form_validation_enabled =
!command_line.HasSwitch(switches::kDisableInteractiveFormValidation);
web_prefs.fullscreen_enabled =
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 2d815bd..d8f6f64 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -2452,6 +2452,9 @@ void Browser::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterBooleanPref(prefs::kClearPluginLSODataEnabled,
true,
PrefService::UNSYNCABLE_PREF);
+ prefs->RegisterBooleanPref(prefs::kEnableMemoryInfo,
+ false,
+ PrefService::UNSYNCABLE_PREF);
// Initialize the disk cache prefs.
prefs->RegisterFilePathPref(prefs::kDiskCacheDir,
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index 90b56fd..1b9922d 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -838,6 +838,9 @@ const char kEnableHyperlinkAuditing[] = "enable_a_ping";
// Whether to enable sending referrers.
const char kEnableReferrers[] = "enable_referrers";
+// Boolean to enable reporting memory info to page.
+const char kEnableMemoryInfo[] = "enable_memory_info";
+
#if defined(OS_MACOSX)
// Whether presentation mode is enabled for fullscreen (used on Lion only).
const char kPresentationModeEnabled[] = "presentation_mode_enabled";
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index 34af347..13587c8 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -319,6 +319,7 @@ extern const char kSSL3Enabled[];
extern const char kTLS1Enabled[];
extern const char kCipherSuiteBlacklist[];
extern const char kEnableOriginBoundCerts[];
+extern const char kEnableMemoryInfo[];
extern const char kMetricsClientID[];
extern const char kMetricsSessionID[];
diff --git a/chrome/test/data/enterprise/chrome-reverse.json b/chrome/test/data/enterprise/chrome-reverse.json
index f47b6c6..ad5c6d7 100644
--- a/chrome/test/data/enterprise/chrome-reverse.json
+++ b/chrome/test/data/enterprise/chrome-reverse.json
@@ -22,6 +22,7 @@
"DnsPrefetchingEnabled": false,
"EditBookmarksEnabled":false,
"EnableAuthNegotiatePort": true,
+ "EnableMemoryInfo": true,
"EnableOriginBoundCerts": true,
"HomepageIsNewTabPage": false,
"HomepageLocation": "http://chromium.org",
diff --git a/chrome/test/data/enterprise/chrome.json b/chrome/test/data/enterprise/chrome.json
index d0863ca..1ed2aaf 100644
--- a/chrome/test/data/enterprise/chrome.json
+++ b/chrome/test/data/enterprise/chrome.json
@@ -38,6 +38,7 @@
"DownloadDirectory": "Downloads",
"EditBookmarksEnabled": true,
"EnableAuthNegotiatePort": false,
+ "EnableMemoryInfo": false,
"EnableOriginBoundCerts": false,
"EnabledPlugins": ["Java"],
"ExtensionInstallBlacklist": ["extension_id1", "extension_id2"],
diff --git a/chrome/test/functional/policy_prefs_ui.py b/chrome/test/functional/policy_prefs_ui.py
index 7ebcd7d..c035bf9 100755
--- a/chrome/test/functional/policy_prefs_ui.py
+++ b/chrome/test/functional/policy_prefs_ui.py
@@ -196,6 +196,7 @@ class PolicyPrefsUITest(policy_base.PolicyTestBase):
'URLWhitelist': ([ 'google.com' ], []),
'EnterpriseWebStoreURL': ('', []),
'EnterpriseWebStoreName': ('', []),
+ 'EnableMemoryInfo': (True, []),
# ChromeOS-only policies:
'ChromeOsLockOnIdleSuspend': (True, [ PERSONAL ], [ 'chromeos' ]),