Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 572 sandbox::TargetPolicy* policy = broker_services->CreatePolicy(); | 572 sandbox::TargetPolicy* policy = broker_services->CreatePolicy(); |
| 573 sandbox::ResultCode result = policy->CreateAlternateDesktop(true); | 573 sandbox::ResultCode result = policy->CreateAlternateDesktop(true); |
| 574 CHECK(sandbox::SBOX_ERROR_FAILED_TO_SWITCH_BACK_WINSTATION != result); | 574 CHECK(sandbox::SBOX_ERROR_FAILED_TO_SWITCH_BACK_WINSTATION != result); |
| 575 policy->Release(); | 575 policy->Release(); |
| 576 } | 576 } |
| 577 } | 577 } |
| 578 #endif | 578 #endif |
| 579 return ChromeTestSuite(argc, argv).Run(); | 579 return ChromeTestSuite(argc, argv).Run(); |
| 580 } | 580 } |
| 581 | 581 |
| 582 // The exit manager is in charge of calling the dtors of singleton objects. | |
| 583 // We need one here because the global variable inside the AtExitManager is a | |
| 584 // different memory location in this .exe versus in chrome.dll, so | |
| 585 // initializing one in ChromeMain() below won't help when it calls back out to | |
| 586 // Singleton-using functions in this .exe. We can't declare this at the top | |
| 587 // of main() because ChromeTestSuite, declared above, also instantiates one. | |
| 588 base::AtExitManager exit_manager; | |
|
cpu_(ooo_6.6-7.5)
2011/04/06 21:11:42
seem correct to me. Different modules need differe
Peter Kasting
2011/04/07 00:29:19
This comment led me to clarify the comment block h
| |
| 589 | |
| 582 #if defined(OS_WIN) | 590 #if defined(OS_WIN) |
| 583 if (command_line->HasSwitch(switches::kProcessType)) { | 591 if (command_line->HasSwitch(switches::kProcessType)) { |
| 584 // This is a child process, call ChromeMain. | 592 // This is a child process, call ChromeMain. |
| 585 FilePath chrome_path(command_line->GetProgram().DirName()); | 593 FilePath chrome_path(command_line->GetProgram().DirName()); |
| 586 chrome_path = chrome_path.Append(chrome::kBrowserResourcesDll); | 594 chrome_path = chrome_path.Append(chrome::kBrowserResourcesDll); |
| 587 HMODULE dll = LoadLibrary(chrome_path.value().c_str()); | 595 HMODULE dll = LoadLibrary(chrome_path.value().c_str()); |
| 588 DLL_MAIN entry_point = | 596 DLL_MAIN entry_point = |
| 589 reinterpret_cast<DLL_MAIN>(::GetProcAddress(dll, "ChromeMain")); | 597 reinterpret_cast<DLL_MAIN>(::GetProcAddress(dll, "ChromeMain")); |
| 590 if (!entry_point) | 598 if (!entry_point) |
| 591 return -1; | 599 return -1; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 628 exit_code = 1; | 636 exit_code = 1; |
| 629 break; | 637 break; |
| 630 } | 638 } |
| 631 | 639 |
| 632 // Special value "-1" means "repeat indefinitely". | 640 // Special value "-1" means "repeat indefinitely". |
| 633 if (cycles != -1) | 641 if (cycles != -1) |
| 634 cycles--; | 642 cycles--; |
| 635 } | 643 } |
| 636 return exit_code; | 644 return exit_code; |
| 637 } | 645 } |
| OLD | NEW |