OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/field_trial.h" | 10 #include "base/field_trial.h" |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 | 546 |
547 // Call Recycle() here as late as possible, just before going into the main | 547 // Call Recycle() here as late as possible, just before going into the main |
548 // loop. We can't do it any earlier, as ProcessCommandLine() will add things | 548 // loop. We can't do it any earlier, as ProcessCommandLine() will add things |
549 // to it in the act of creating the initial browser window. | 549 // to it in the act of creating the initial browser window. |
550 int result_code = ResultCodes::NORMAL_EXIT; | 550 int result_code = ResultCodes::NORMAL_EXIT; |
551 if (parameters.ui_task) { | 551 if (parameters.ui_task) { |
552 if (pool) pool->Recycle(); | 552 if (pool) pool->Recycle(); |
553 MessageLoopForUI::current()->PostTask(FROM_HERE, parameters.ui_task); | 553 MessageLoopForUI::current()->PostTask(FROM_HERE, parameters.ui_task); |
554 RunUIMessageLoop(browser_process.get()); | 554 RunUIMessageLoop(browser_process.get()); |
555 } else if (BrowserInit::ProcessCommandLine(parsed_command_line, | 555 } else if (BrowserInit::ProcessCommandLine(parsed_command_line, |
556 std::wstring(), local_state, true, | 556 std::wstring(), true, profile, |
557 profile, &result_code)) { | 557 &result_code)) { |
558 if (pool) pool->Recycle(); | 558 if (pool) pool->Recycle(); |
559 RunUIMessageLoop(browser_process.get()); | 559 RunUIMessageLoop(browser_process.get()); |
560 } | 560 } |
561 | 561 |
562 Platform::WillTerminate(); | 562 Platform::WillTerminate(); |
563 | 563 |
564 if (metrics) | 564 if (metrics) |
565 metrics->Stop(); | 565 metrics->Stop(); |
566 | 566 |
567 // browser_shutdown takes care of deleting browser_process, so we need to | 567 // browser_shutdown takes care of deleting browser_process, so we need to |
568 // release it. | 568 // release it. |
569 browser_process.release(); | 569 browser_process.release(); |
570 browser_shutdown::Shutdown(); | 570 browser_shutdown::Shutdown(); |
571 | 571 |
572 return result_code; | 572 return result_code; |
573 } | 573 } |
OLD | NEW |