Chromium Code Reviews| 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 "content/public/app/content_main_runner.h" | 5 #include "content/public/app/content_main_runner.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include "base/allocator/allocator_extension.h" | 9 #include "base/allocator/allocator_extension.h" |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 #include "content/public/plugin/content_plugin_client.h" | 67 #include "content/public/plugin/content_plugin_client.h" |
| 68 #include "content/public/renderer/content_renderer_client.h" | 68 #include "content/public/renderer/content_renderer_client.h" |
| 69 #include "content/public/utility/content_utility_client.h" | 69 #include "content/public/utility/content_utility_client.h" |
| 70 #endif | 70 #endif |
| 71 | 71 |
| 72 #if defined(OS_WIN) | 72 #if defined(OS_WIN) |
| 73 #include <atlbase.h> | 73 #include <atlbase.h> |
| 74 #include <atlapp.h> | 74 #include <atlapp.h> |
| 75 #include <malloc.h> | 75 #include <malloc.h> |
| 76 #include <cstring> | 76 #include <cstring> |
| 77 #include "base/strings/string_number_conversions.h" | |
|
sky
2014/06/03 15:59:06
nit: newline between 76/77.
ananta
2014/06/03 19:18:13
Done.
| |
| 78 #include "ui/gfx/win/dpi.h" | |
| 77 #elif defined(OS_MACOSX) | 79 #elif defined(OS_MACOSX) |
| 78 #include "base/mac/scoped_nsautorelease_pool.h" | 80 #include "base/mac/scoped_nsautorelease_pool.h" |
| 79 #if !defined(OS_IOS) | 81 #if !defined(OS_IOS) |
| 80 #include "base/power_monitor/power_monitor_device_source.h" | 82 #include "base/power_monitor/power_monitor_device_source.h" |
| 81 #include "content/browser/mach_broker_mac.h" | 83 #include "content/browser/mach_broker_mac.h" |
| 82 #include "content/common/sandbox_init_mac.h" | 84 #include "content/common/sandbox_init_mac.h" |
| 83 #endif // !OS_IOS | 85 #endif // !OS_IOS |
| 84 #endif // OS_WIN | 86 #endif // OS_WIN |
| 85 | 87 |
| 86 #if defined(OS_POSIX) | 88 #if defined(OS_POSIX) |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 651 } | 653 } |
| 652 | 654 |
| 653 if (!process_type.empty() && | 655 if (!process_type.empty() && |
| 654 (!delegate_ || delegate_->ShouldSendMachPort(process_type))) { | 656 (!delegate_ || delegate_->ShouldSendMachPort(process_type))) { |
| 655 MachBroker::ChildSendTaskPortToParent(); | 657 MachBroker::ChildSendTaskPortToParent(); |
| 656 } | 658 } |
| 657 #elif defined(OS_WIN) | 659 #elif defined(OS_WIN) |
| 658 if (command_line.HasSwitch(switches::kEnableHighResolutionTime)) | 660 if (command_line.HasSwitch(switches::kEnableHighResolutionTime)) |
| 659 base::TimeTicks::SetNowIsHighResNowIfSupported(); | 661 base::TimeTicks::SetNowIsHighResNowIfSupported(); |
| 660 | 662 |
| 663 if (command_line.HasSwitch(switches::kUseDeviceScaleFactor)) { | |
| 664 std::string scale_factor_string = command_line.GetSwitchValueASCII( | |
| 665 switches::kUseDeviceScaleFactor); | |
| 666 double scale_factor = 0; | |
| 667 if (base::StringToDouble(scale_factor_string, &scale_factor)) | |
| 668 gfx::InitDeviceScaleFactor(scale_factor); | |
| 669 } | |
|
sky
2014/06/03 15:59:06
Can you keep the DCHECK in GetDeviceScaleFactor()
ananta
2014/06/03 19:18:37
Done.
| |
| 661 SetupCRT(command_line); | 670 SetupCRT(command_line); |
| 662 #endif | 671 #endif |
| 663 | 672 |
| 664 #if defined(OS_POSIX) | 673 #if defined(OS_POSIX) |
| 665 if (!process_type.empty()) { | 674 if (!process_type.empty()) { |
| 666 // When you hit Ctrl-C in a terminal running the browser | 675 // When you hit Ctrl-C in a terminal running the browser |
| 667 // process, a SIGINT is delivered to the entire process group. | 676 // process, a SIGINT is delivered to the entire process group. |
| 668 // When debugging the browser process via gdb, gdb catches the | 677 // When debugging the browser process via gdb, gdb catches the |
| 669 // SIGINT for the browser process (and dumps you back to the gdb | 678 // SIGINT for the browser process (and dumps you back to the gdb |
| 670 // console) but doesn't for the child processes, killing them. | 679 // console) but doesn't for the child processes, killing them. |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 800 | 809 |
| 801 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 810 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
| 802 }; | 811 }; |
| 803 | 812 |
| 804 // static | 813 // static |
| 805 ContentMainRunner* ContentMainRunner::Create() { | 814 ContentMainRunner* ContentMainRunner::Create() { |
| 806 return new ContentMainRunnerImpl(); | 815 return new ContentMainRunnerImpl(); |
| 807 } | 816 } |
| 808 | 817 |
| 809 } // namespace content | 818 } // namespace content |
| OLD | NEW |