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

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 14017013: Initialize CrosSettings before SetupMetrics (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #if defined(TOOLKIT_GTK) 7 #if defined(TOOLKIT_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 #if defined(OS_MACOSX) 939 #if defined(OS_MACOSX)
940 // Get the Keychain API to register for distributed notifications on the main 940 // Get the Keychain API to register for distributed notifications on the main
941 // thread, which has a proper CFRunloop, instead of later on the I/O thread, 941 // thread, which has a proper CFRunloop, instead of later on the I/O thread,
942 // which doesn't. This ensures those notifications will get delivered 942 // which doesn't. This ensures those notifications will get delivered
943 // properly. See issue 37766. 943 // properly. See issue 37766.
944 // (Note that the callback mask here is empty. I don't want to register for 944 // (Note that the callback mask here is empty. I don't want to register for
945 // any callbacks, I just want to initialize the mechanism.) 945 // any callbacks, I just want to initialize the mechanism.)
946 SecKeychainAddCallback(&KeychainCallback, 0, NULL); 946 SecKeychainAddCallback(&KeychainCallback, 0, NULL);
947 #endif 947 #endif
948 948
949 #if defined(OS_CHROMEOS)
950 // Must be done after g_browser_process is constructed, before
951 // SetupMetricsAndFieldTrials().
952 chromeos::CrosSettings::Initialize();
953 #endif
954
949 // Now the command line has been mutated based on about:flags, we can setup 955 // Now the command line has been mutated based on about:flags, we can setup
950 // metrics and initialize field trials. The field trials are needed by 956 // metrics and initialize field trials. The field trials are needed by
951 // IOThread's initialization which happens in BrowserProcess:PreCreateThreads. 957 // IOThread's initialization which happens in BrowserProcess:PreCreateThreads.
952 SetupMetricsAndFieldTrials(); 958 SetupMetricsAndFieldTrials();
953 959
954 // ChromeOS needs ResourceBundle::InitSharedInstance to be called before this. 960 // ChromeOS needs ResourceBundle::InitSharedInstance to be called before this.
955 browser_process_->PreCreateThreads(); 961 browser_process_->PreCreateThreads();
956 962
957 return content::RESULT_CODE_NORMAL_EXIT; 963 return content::RESULT_CODE_NORMAL_EXIT;
958 } 964 }
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
1668 browser_shutdown::ShutdownPostThreadsStop(restart_last_session_); 1674 browser_shutdown::ShutdownPostThreadsStop(restart_last_session_);
1669 master_prefs_.reset(); 1675 master_prefs_.reset();
1670 process_singleton_.reset(); 1676 process_singleton_.reset();
1671 1677
1672 // We need to do this check as late as possible, but due to modularity, this 1678 // We need to do this check as late as possible, but due to modularity, this
1673 // may be the last point in Chrome. This would be more effective if done at 1679 // may be the last point in Chrome. This would be more effective if done at
1674 // a higher level on the stack, so that it is impossible for an early return 1680 // a higher level on the stack, so that it is impossible for an early return
1675 // to bypass this code. Perhaps we need a *final* hook that is called on all 1681 // to bypass this code. Perhaps we need a *final* hook that is called on all
1676 // paths from content/browser/browser_main. 1682 // paths from content/browser/browser_main.
1677 CHECK(MetricsService::UmaMetricsProperlyShutdown()); 1683 CHECK(MetricsService::UmaMetricsProperlyShutdown());
1684
1685 #if defined(OS_CHROMEOS)
1686 chromeos::CrosSettings::Shutdown();
1687 #endif
1678 #endif 1688 #endif
1679 } 1689 }
1680 1690
1681 // Public members: 1691 // Public members:
1682 1692
1683 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1693 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1684 chrome_extra_parts_.push_back(parts); 1694 chrome_extra_parts_.push_back(parts);
1685 } 1695 }
1686 1696
1687 // Misc ------------------------------------------------------------------------ 1697 // Misc ------------------------------------------------------------------------
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 if (base::win::GetVersion() <= base::win::VERSION_XP) 1745 if (base::win::GetVersion() <= base::win::VERSION_XP)
1736 uma_name += "_XP"; 1746 uma_name += "_XP";
1737 1747
1738 uma_name += "_PreRead_"; 1748 uma_name += "_PreRead_";
1739 uma_name += pre_read_percentage; 1749 uma_name += pre_read_percentage;
1740 AddPreReadHistogramTime(uma_name.c_str(), time); 1750 AddPreReadHistogramTime(uma_name.c_str(), time);
1741 } 1751 }
1742 #endif 1752 #endif
1743 #endif 1753 #endif
1744 } 1754 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698