OLD | NEW |
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 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 RunPageCycler(); | 921 RunPageCycler(); |
922 | 922 |
923 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) | 923 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) |
924 chrome_extra_parts_[i]->PostBrowserStart(); | 924 chrome_extra_parts_[i]->PostBrowserStart(); |
925 // Allow ProcessSingleton to process messages. | 925 // Allow ProcessSingleton to process messages. |
926 process_singleton_->Unlock(); | 926 process_singleton_->Unlock(); |
927 } | 927 } |
928 | 928 |
929 void ChromeBrowserMainParts::RunPageCycler() { | 929 void ChromeBrowserMainParts::RunPageCycler() { |
930 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 930 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
931 // We assume a native desktop for tests, but we will need to find a way to | 931 Browser* browser = browser::FindBrowserWithProfile(profile_); |
932 // get the proper host desktop type once we start running these tests in ASH. | |
933 Browser* browser = browser::FindBrowserWithProfile( | |
934 profile_, chrome::HOST_DESKTOP_TYPE_NATIVE); | |
935 DCHECK(browser); | 932 DCHECK(browser); |
936 PageCycler* page_cycler = NULL; | 933 PageCycler* page_cycler = NULL; |
937 FilePath input_file = | 934 FilePath input_file = |
938 command_line->GetSwitchValuePath(switches::kVisitURLs); | 935 command_line->GetSwitchValuePath(switches::kVisitURLs); |
939 page_cycler = new PageCycler(browser, input_file); | 936 page_cycler = new PageCycler(browser, input_file); |
940 page_cycler->set_errors_file( | 937 page_cycler->set_errors_file( |
941 input_file.AddExtension(FILE_PATH_LITERAL(".errors"))); | 938 input_file.AddExtension(FILE_PATH_LITERAL(".errors"))); |
942 if (command_line->HasSwitch(switches::kRecordStats)) { | 939 if (command_line->HasSwitch(switches::kRecordStats)) { |
943 page_cycler->set_stats_file( | 940 page_cycler->set_stats_file( |
944 command_line->GetSwitchValuePath(switches::kRecordStats)); | 941 command_line->GetSwitchValuePath(switches::kRecordStats)); |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1563 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1560 if (base::win::GetVersion() <= base::win::VERSION_XP) |
1564 uma_name += "_XP"; | 1561 uma_name += "_XP"; |
1565 | 1562 |
1566 uma_name += "_PreRead_"; | 1563 uma_name += "_PreRead_"; |
1567 uma_name += pre_read_percentage; | 1564 uma_name += pre_read_percentage; |
1568 AddPreReadHistogramTime(uma_name.c_str(), time); | 1565 AddPreReadHistogramTime(uma_name.c_str(), time); |
1569 } | 1566 } |
1570 #endif | 1567 #endif |
1571 #endif | 1568 #endif |
1572 } | 1569 } |
OLD | NEW |