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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 #include "content/public/common/sandbox_init.h" | 42 #include "content/public/common/sandbox_init.h" |
43 #include "content/renderer/in_process_renderer_thread.h" | 43 #include "content/renderer/in_process_renderer_thread.h" |
44 #include "content/utility/in_process_utility_thread.h" | 44 #include "content/utility/in_process_utility_thread.h" |
45 #include "crypto/nss_util.h" | 45 #include "crypto/nss_util.h" |
46 #include "ipc/ipc_descriptors.h" | 46 #include "ipc/ipc_descriptors.h" |
47 #include "ipc/ipc_switches.h" | 47 #include "ipc/ipc_switches.h" |
48 #include "media/base/media.h" | 48 #include "media/base/media.h" |
49 #include "sandbox/win/src/sandbox_types.h" | 49 #include "sandbox/win/src/sandbox_types.h" |
50 #include "ui/base/ui_base_paths.h" | 50 #include "ui/base/ui_base_paths.h" |
51 #include "ui/base/ui_base_switches.h" | 51 #include "ui/base/ui_base_switches.h" |
52 #include "ui/gfx/win/dpi.h" | |
53 | 52 |
54 #if defined(USE_TCMALLOC) | 53 #if defined(USE_TCMALLOC) |
55 #include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h" | 54 #include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h" |
56 #if defined(TYPE_PROFILING) | 55 #if defined(TYPE_PROFILING) |
57 #include "base/allocator/type_profiler.h" | 56 #include "base/allocator/type_profiler.h" |
58 #include "base/allocator/type_profiler_tcmalloc.h" | 57 #include "base/allocator/type_profiler_tcmalloc.h" |
59 #endif | 58 #endif |
60 #endif | 59 #endif |
61 | 60 |
62 #if !defined(OS_IOS) | 61 #if !defined(OS_IOS) |
63 #include "content/app/mojo/mojo_init.h" | 62 #include "content/app/mojo/mojo_init.h" |
64 #include "content/browser/gpu/gpu_process_host.h" | 63 #include "content/browser/gpu/gpu_process_host.h" |
65 #include "content/browser/renderer_host/render_process_host_impl.h" | 64 #include "content/browser/renderer_host/render_process_host_impl.h" |
66 #include "content/browser/utility_process_host_impl.h" | 65 #include "content/browser/utility_process_host_impl.h" |
67 #include "content/public/plugin/content_plugin_client.h" | 66 #include "content/public/plugin/content_plugin_client.h" |
68 #include "content/public/renderer/content_renderer_client.h" | 67 #include "content/public/renderer/content_renderer_client.h" |
69 #include "content/public/utility/content_utility_client.h" | 68 #include "content/public/utility/content_utility_client.h" |
70 #endif | 69 #endif |
71 | 70 |
72 #if defined(OS_WIN) | 71 #if defined(OS_WIN) |
73 #include <atlbase.h> | 72 #include <atlbase.h> |
74 #include <atlapp.h> | 73 #include <atlapp.h> |
75 #include <malloc.h> | 74 #include <malloc.h> |
76 #include <cstring> | 75 #include <cstring> |
76 | |
77 #include "base/strings/string_number_conversions.h" | |
78 #include "ui/base/win/dpi_setup.h" | |
79 #include "ui/gfx/win/dpi.h" | |
77 #elif defined(OS_MACOSX) | 80 #elif defined(OS_MACOSX) |
78 #include "base/mac/scoped_nsautorelease_pool.h" | 81 #include "base/mac/scoped_nsautorelease_pool.h" |
79 #if !defined(OS_IOS) | 82 #if !defined(OS_IOS) |
80 #include "base/power_monitor/power_monitor_device_source.h" | 83 #include "base/power_monitor/power_monitor_device_source.h" |
81 #include "content/browser/mach_broker_mac.h" | 84 #include "content/browser/mach_broker_mac.h" |
82 #include "content/common/sandbox_init_mac.h" | 85 #include "content/common/sandbox_init_mac.h" |
83 #endif // !OS_IOS | 86 #endif // !OS_IOS |
84 #endif // OS_WIN | 87 #endif // OS_WIN |
85 | 88 |
86 #if defined(OS_POSIX) | 89 #if defined(OS_POSIX) |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
651 } | 654 } |
652 | 655 |
653 if (!process_type.empty() && | 656 if (!process_type.empty() && |
654 (!delegate_ || delegate_->ShouldSendMachPort(process_type))) { | 657 (!delegate_ || delegate_->ShouldSendMachPort(process_type))) { |
655 MachBroker::ChildSendTaskPortToParent(); | 658 MachBroker::ChildSendTaskPortToParent(); |
656 } | 659 } |
657 #elif defined(OS_WIN) | 660 #elif defined(OS_WIN) |
658 if (command_line.HasSwitch(switches::kEnableHighResolutionTime)) | 661 if (command_line.HasSwitch(switches::kEnableHighResolutionTime)) |
659 base::TimeTicks::SetNowIsHighResNowIfSupported(); | 662 base::TimeTicks::SetNowIsHighResNowIfSupported(); |
660 | 663 |
664 if (command_line.HasSwitch(switches::kDeviceScaleFactor)) { | |
665 std::string scale_factor_string = command_line.GetSwitchValueASCII( | |
666 switches::kDeviceScaleFactor); | |
667 double scale_factor = 0; | |
668 if (base::StringToDouble(scale_factor_string, &scale_factor)) | |
sky
2014/06/03 20:11:43
Don't you need to handle the else care here?
ananta
2014/06/03 20:43:24
Done.
| |
669 gfx::InitDeviceScaleFactor(scale_factor); | |
670 } else { | |
671 ui::win::InitDeviceScaleFactor(); | |
672 } | |
661 SetupCRT(command_line); | 673 SetupCRT(command_line); |
662 #endif | 674 #endif |
663 | 675 |
664 #if defined(OS_POSIX) | 676 #if defined(OS_POSIX) |
665 if (!process_type.empty()) { | 677 if (!process_type.empty()) { |
666 // When you hit Ctrl-C in a terminal running the browser | 678 // When you hit Ctrl-C in a terminal running the browser |
667 // process, a SIGINT is delivered to the entire process group. | 679 // process, a SIGINT is delivered to the entire process group. |
668 // When debugging the browser process via gdb, gdb catches the | 680 // When debugging the browser process via gdb, gdb catches the |
669 // SIGINT for the browser process (and dumps you back to the gdb | 681 // SIGINT for the browser process (and dumps you back to the gdb |
670 // console) but doesn't for the child processes, killing them. | 682 // console) but doesn't for the child processes, killing them. |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
800 | 812 |
801 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 813 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
802 }; | 814 }; |
803 | 815 |
804 // static | 816 // static |
805 ContentMainRunner* ContentMainRunner::Create() { | 817 ContentMainRunner* ContentMainRunner::Create() { |
806 return new ContentMainRunnerImpl(); | 818 return new ContentMainRunnerImpl(); |
807 } | 819 } |
808 | 820 |
809 } // namespace content | 821 } // namespace content |
OLD | NEW |