OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser_main.h" | 5 #include "chrome/browser/browser_main.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/hi_res_timer_manager.h" | 9 #include "app/hi_res_timer_manager.h" |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
11 #include "app/resource_bundle.h" | 11 #include "app/resource_bundle.h" |
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 // Configure the network module so it has access to resources. | 790 // Configure the network module so it has access to resources. |
791 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); | 791 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); |
792 | 792 |
793 // Register our global network handler for chrome:// and | 793 // Register our global network handler for chrome:// and |
794 // chrome-extension:// URLs. | 794 // chrome-extension:// URLs. |
795 RegisterURLRequestChromeJob(); | 795 RegisterURLRequestChromeJob(); |
796 RegisterExtensionProtocols(); | 796 RegisterExtensionProtocols(); |
797 RegisterMetadataURLRequestHandler(); | 797 RegisterMetadataURLRequestHandler(); |
798 | 798 |
799 // In unittest mode, this will do nothing. In normal mode, this will create | 799 // In unittest mode, this will do nothing. In normal mode, this will create |
800 // the global GoogleURLTracker instance, which will promptly go to sleep for | 800 // the global GoogleURLTracker and IntranetRedirectDetector instances, which |
801 // five seconds (to avoid slowing startup), and wake up afterwards to see if | 801 // will promptly go to sleep for five and seven seconds, respectively (to |
802 // it should do anything else. If we don't cause this creation now, it won't | 802 // avoid slowing startup), and wake up afterwards to see if they should do |
803 // happen until someone else asks for the tracker, at which point we may no | 803 // anything else. |
804 // longer want to sleep for five seconds. | |
805 // | 804 // |
806 // A simpler way of doing all this would be to have some function which could | 805 // A simpler way of doing all this would be to have some function which could |
807 // give the time elapsed since startup, and simply have the tracker check that | 806 // give the time elapsed since startup, and simply have these objects check |
808 // when asked to initialize itself, but this doesn't seem to exist. | 807 // that when asked to initialize themselves, but this doesn't seem to exist. |
809 // | 808 // |
810 // This can't be created in the BrowserProcessImpl constructor because it | 809 // These can't be created in the BrowserProcessImpl constructor because they |
811 // needs to read prefs that get set after that runs. | 810 // need to read prefs that get set after that runs. |
812 browser_process->google_url_tracker(); | 811 browser_process->google_url_tracker(); |
| 812 browser_process->intranet_redirect_detector(); |
813 | 813 |
814 // Have Chrome plugins write their data to the profile directory. | 814 // Have Chrome plugins write their data to the profile directory. |
815 PluginService::GetInstance()->SetChromePluginDataDir(profile->GetPath()); | 815 PluginService::GetInstance()->SetChromePluginDataDir(profile->GetPath()); |
816 | 816 |
817 // Prepare for memory caching of SDCH dictionaries. | 817 // Prepare for memory caching of SDCH dictionaries. |
818 // Perform A/B test to measure global impact of SDCH support. | 818 // Perform A/B test to measure global impact of SDCH support. |
819 // Set up a field trial to see what disabling SDCH does to latency of page | 819 // Set up a field trial to see what disabling SDCH does to latency of page |
820 // layout globally. | 820 // layout globally. |
821 FieldTrial::Probability kSDCH_DIVISOR = 10000; | 821 FieldTrial::Probability kSDCH_DIVISOR = 10000; |
822 FieldTrial::Probability kSDCH_DISABLE_PROBABILITY = 5; // 0.05% probability. | 822 FieldTrial::Probability kSDCH_DISABLE_PROBABILITY = 5; // 0.05% probability. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 if (metrics) | 924 if (metrics) |
925 metrics->Stop(); | 925 metrics->Stop(); |
926 | 926 |
927 // browser_shutdown takes care of deleting browser_process, so we need to | 927 // browser_shutdown takes care of deleting browser_process, so we need to |
928 // release it. | 928 // release it. |
929 browser_process.release(); | 929 browser_process.release(); |
930 browser_shutdown::Shutdown(); | 930 browser_shutdown::Shutdown(); |
931 | 931 |
932 return result_code; | 932 return result_code; |
933 } | 933 } |
OLD | NEW |