Bug 842932 - Update to use Preferences::RegisterCallbackAndCall to correct pref callback from getting wrong params. r=smaug

This commit is contained in:
Dave Hylands 2013-02-20 11:49:51 -08:00
Родитель 812552ed00
Коммит c5d845e67c
1 изменённых файлов: 44 добавлений и 72 удалений

Просмотреть файл

@ -3588,95 +3588,67 @@ nsJSRuntime::Init()
SetDOMCallbacks(sRuntime, &DOMcallbacks); SetDOMCallbacks(sRuntime, &DOMcallbacks);
// Set these global xpconnect options... // Set these global xpconnect options...
Preferences::RegisterCallback(MaxScriptRunTimePrefChangedCallback, Preferences::RegisterCallbackAndCall(MaxScriptRunTimePrefChangedCallback,
"dom.max_script_run_time"); "dom.max_script_run_time");
MaxScriptRunTimePrefChangedCallback("dom.max_script_run_time", nullptr);
Preferences::RegisterCallback(MaxScriptRunTimePrefChangedCallback, Preferences::RegisterCallbackAndCall(MaxScriptRunTimePrefChangedCallback,
"dom.max_chrome_script_run_time"); "dom.max_chrome_script_run_time");
MaxScriptRunTimePrefChangedCallback("dom.max_chrome_script_run_time",
nullptr);
Preferences::RegisterCallback(ReportAllJSExceptionsPrefChangedCallback, Preferences::RegisterCallbackAndCall(ReportAllJSExceptionsPrefChangedCallback,
"dom.report_all_js_exceptions"); "dom.report_all_js_exceptions");
ReportAllJSExceptionsPrefChangedCallback("dom.report_all_js_exceptions",
nullptr);
Preferences::RegisterCallback(SetMemoryHighWaterMarkPrefChangedCallback, Preferences::RegisterCallbackAndCall(SetMemoryHighWaterMarkPrefChangedCallback,
"javascript.options.mem.high_water_mark"); "javascript.options.mem.high_water_mark");
SetMemoryHighWaterMarkPrefChangedCallback("javascript.options.mem.high_water_mark",
nullptr);
Preferences::RegisterCallback(SetMemoryMaxPrefChangedCallback, Preferences::RegisterCallbackAndCall(SetMemoryMaxPrefChangedCallback,
"javascript.options.mem.max"); "javascript.options.mem.max");
SetMemoryMaxPrefChangedCallback("javascript.options.mem.max",
nullptr);
Preferences::RegisterCallback(SetMemoryGCModePrefChangedCallback, Preferences::RegisterCallbackAndCall(SetMemoryGCModePrefChangedCallback,
"javascript.options.mem.gc_per_compartment"); "javascript.options.mem.gc_per_compartment");
SetMemoryGCModePrefChangedCallback("javascript.options.mem.gc_per_compartment",
nullptr);
Preferences::RegisterCallback(SetMemoryGCModePrefChangedCallback, Preferences::RegisterCallbackAndCall(SetMemoryGCModePrefChangedCallback,
"javascript.options.mem.gc_incremental"); "javascript.options.mem.gc_incremental");
SetMemoryGCModePrefChangedCallback("javascript.options.mem.gc_incremental",
nullptr);
Preferences::RegisterCallback(SetMemoryGCSliceTimePrefChangedCallback, Preferences::RegisterCallbackAndCall(SetMemoryGCSliceTimePrefChangedCallback,
"javascript.options.mem.gc_incremental_slice_ms"); "javascript.options.mem.gc_incremental_slice_ms");
SetMemoryGCSliceTimePrefChangedCallback("javascript.options.mem.gc_incremental_slice_ms",
nullptr);
Preferences::RegisterCallback(SetMemoryGCPrefChangedCallback, Preferences::RegisterCallbackAndCall(SetMemoryGCPrefChangedCallback,
"javascript.options.mem.gc_high_frequency_time_limit_ms"); "javascript.options.mem.gc_high_frequency_time_limit_ms",
SetMemoryGCPrefChangedCallback("javascript.options.mem.gc_high_frequency_time_limit_ms", (void *)JSGC_HIGH_FREQUENCY_TIME_LIMIT);
(void *)JSGC_HIGH_FREQUENCY_TIME_LIMIT);
Preferences::RegisterCallback(SetMemoryGCDynamicMarkSlicePrefChangedCallback, Preferences::RegisterCallbackAndCall(SetMemoryGCDynamicMarkSlicePrefChangedCallback,
"javascript.options.mem.gc_dynamic_mark_slice"); "javascript.options.mem.gc_dynamic_mark_slice");
SetMemoryGCDynamicMarkSlicePrefChangedCallback("javascript.options.mem.gc_dynamic_mark_slice",
nullptr);
Preferences::RegisterCallback(SetMemoryGCDynamicHeapGrowthPrefChangedCallback, Preferences::RegisterCallbackAndCall(SetMemoryGCDynamicHeapGrowthPrefChangedCallback,
"javascript.options.mem.gc_dynamic_heap_growth"); "javascript.options.mem.gc_dynamic_heap_growth");
SetMemoryGCDynamicHeapGrowthPrefChangedCallback("javascript.options.mem.gc_dynamic_heap_growth",
nullptr);
Preferences::RegisterCallback(SetMemoryGCPrefChangedCallback, Preferences::RegisterCallbackAndCall(SetMemoryGCPrefChangedCallback,
"javascript.options.mem.gc_low_frequency_heap_growth"); "javascript.options.mem.gc_low_frequency_heap_growth",
SetMemoryGCPrefChangedCallback("javascript.options.mem.gc_low_frequency_heap_growth", (void *)JSGC_LOW_FREQUENCY_HEAP_GROWTH);
(void *)JSGC_LOW_FREQUENCY_HEAP_GROWTH);
Preferences::RegisterCallback(SetMemoryGCPrefChangedCallback, Preferences::RegisterCallbackAndCall(SetMemoryGCPrefChangedCallback,
"javascript.options.mem.gc_high_frequency_heap_growth_min"); "javascript.options.mem.gc_high_frequency_heap_growth_min",
SetMemoryGCPrefChangedCallback("javascript.options.mem.gc_high_frequency_heap_growth_min", (void *)JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MIN);
(void *)JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MIN);
Preferences::RegisterCallback(SetMemoryGCPrefChangedCallback, Preferences::RegisterCallbackAndCall(SetMemoryGCPrefChangedCallback,
"javascript.options.mem.gc_high_frequency_heap_growth_max"); "javascript.options.mem.gc_high_frequency_heap_growth_max",
SetMemoryGCPrefChangedCallback("javascript.options.mem.gc_high_frequency_heap_growth_max", (void *)JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MAX);
(void *)JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MAX);
Preferences::RegisterCallback(SetMemoryGCPrefChangedCallback, Preferences::RegisterCallbackAndCall(SetMemoryGCPrefChangedCallback,
"javascript.options.mem.gc_high_frequency_low_limit_mb"); "javascript.options.mem.gc_high_frequency_low_limit_mb",
SetMemoryGCPrefChangedCallback("javascript.options.mem.gc_high_frequency_low_limit_mb", (void *)JSGC_HIGH_FREQUENCY_LOW_LIMIT);
(void *)JSGC_HIGH_FREQUENCY_LOW_LIMIT);
Preferences::RegisterCallback(SetMemoryGCPrefChangedCallback, Preferences::RegisterCallbackAndCall(SetMemoryGCPrefChangedCallback,
"javascript.options.mem.gc_high_frequency_high_limit_mb"); "javascript.options.mem.gc_high_frequency_high_limit_mb",
SetMemoryGCPrefChangedCallback("javascript.options.mem.gc_high_frequency_high_limit_mb", (void *)JSGC_HIGH_FREQUENCY_HIGH_LIMIT);
(void *)JSGC_HIGH_FREQUENCY_HIGH_LIMIT);
Preferences::RegisterCallback(SetMemoryGCPrefChangedCallback, Preferences::RegisterCallbackAndCall(SetMemoryGCPrefChangedCallback,
"javascript.options.mem.analysis_purge_mb", "javascript.options.mem.analysis_purge_mb",
(void *)JSGC_ANALYSIS_PURGE_TRIGGER); (void *)JSGC_ANALYSIS_PURGE_TRIGGER);
SetMemoryGCPrefChangedCallback("javascript.options.mem.analysis_purge_mb",
(void *)JSGC_ANALYSIS_PURGE_TRIGGER);
Preferences::RegisterCallback(SetMemoryGCPrefChangedCallback, Preferences::RegisterCallbackAndCall(SetMemoryGCPrefChangedCallback,
"javascript.options.mem.gc_allocation_threshold_mb"); "javascript.options.mem.gc_allocation_threshold_mb",
SetMemoryGCPrefChangedCallback("javascript.options.mem.gc_allocation_threshold_mb", (void *)JSGC_ALLOCATION_THRESHOLD);
(void *)JSGC_ALLOCATION_THRESHOLD);
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService(); nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
if (!obs) if (!obs)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;