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

Side by Side Diff: chrome/browser/prefs/browser_prefs.cc

Issue 665283002: Fix crash in ChromeZoomLevelPrefs::ExtractPerHostZoomLevels(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wjmResetZoomLevel
Patch Set: Convert parameter to bool. Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/zoom/chrome_zoom_level_prefs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/prefs/browser_prefs.h" 5 #include "chrome/browser/prefs/browser_prefs.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 680
681 const base::DictionaryValue* host_zoom_dictionary = 681 const base::DictionaryValue* host_zoom_dictionary =
682 prefs->GetDictionary(prefs::kPerHostZoomLevelsDeprecated); 682 prefs->GetDictionary(prefs::kPerHostZoomLevelsDeprecated);
683 // Collect stats on frequency with which migrations are occuring. This measure 683 // Collect stats on frequency with which migrations are occuring. This measure
684 // is not perfect, since it will consider an un-migrated user with only 684 // is not perfect, since it will consider an un-migrated user with only
685 // default value as being already migrated, but it will catch all non-trivial 685 // default value as being already migrated, but it will catch all non-trivial
686 // migrations. 686 // migrations.
687 migrated |= !host_zoom_dictionary->empty(); 687 migrated |= !host_zoom_dictionary->empty();
688 UMA_HISTOGRAM_BOOLEAN("Settings.ZoomLevelPreferencesMigrated", migrated); 688 UMA_HISTOGRAM_BOOLEAN("Settings.ZoomLevelPreferencesMigrated", migrated);
689 689
690 zoom_level_prefs->ExtractPerHostZoomLevels(host_zoom_dictionary); 690 // Since |host_zoom_dictionary| is not partition-based, do not attempt to
691 // sanitize it.
692 zoom_level_prefs->ExtractPerHostZoomLevels(
693 host_zoom_dictionary, false /* sanitize_partition_host_zoom_levels */);
691 694
692 // We're done migrating the profile per-host zoom level values, so we clear 695 // We're done migrating the profile per-host zoom level values, so we clear
693 // them all. 696 // them all.
694 DictionaryPrefUpdate host_zoom_dictionary_update( 697 DictionaryPrefUpdate host_zoom_dictionary_update(
695 prefs, prefs::kPerHostZoomLevelsDeprecated); 698 prefs, prefs::kPerHostZoomLevelsDeprecated);
696 host_zoom_dictionary_update->Clear(); 699 host_zoom_dictionary_update->Clear();
697 } 700 }
698 701
699 } // namespace chrome 702 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/zoom/chrome_zoom_level_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698