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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 #include <malloc.h> | 76 #include <malloc.h> |
77 #include <cstring> | 77 #include <cstring> |
78 | 78 |
79 #include "base/strings/string_number_conversions.h" | 79 #include "base/strings/string_number_conversions.h" |
80 #include "base/trace_event/trace_event_etw_export_win.h" | 80 #include "base/trace_event/trace_event_etw_export_win.h" |
81 #include "ui/base/win/atl_module.h" | 81 #include "ui/base/win/atl_module.h" |
82 #include "ui/gfx/win/dpi.h" | 82 #include "ui/gfx/win/dpi.h" |
83 #elif defined(OS_MACOSX) | 83 #elif defined(OS_MACOSX) |
84 #include "base/mac/scoped_nsautorelease_pool.h" | 84 #include "base/mac/scoped_nsautorelease_pool.h" |
85 #if !defined(OS_IOS) | 85 #if !defined(OS_IOS) |
86 #include <CoreFoundation/CoreFoundation.h> | |
87 #include "base/mac/mac_util.h" | |
88 #include "base/mac/scoped_cftyperef.h" | |
86 #include "base/power_monitor/power_monitor_device_source.h" | 89 #include "base/power_monitor/power_monitor_device_source.h" |
90 #include "base/strings/sys_string_conversions.h" | |
87 #include "content/browser/mach_broker_mac.h" | 91 #include "content/browser/mach_broker_mac.h" |
88 #include "content/common/sandbox_init_mac.h" | 92 #include "content/common/sandbox_init_mac.h" |
89 #endif // !OS_IOS | 93 #endif // !OS_IOS |
90 #endif // OS_WIN | 94 #endif // OS_WIN |
91 | 95 |
92 #if defined(OS_POSIX) | 96 #if defined(OS_POSIX) |
93 #include <signal.h> | 97 #include <signal.h> |
94 | 98 |
95 #include "base/posix/global_descriptors.h" | 99 #include "base/posix/global_descriptors.h" |
96 #include "content/public/common/content_descriptors.h" | 100 #include "content/public/common/content_descriptors.h" |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
544 | 548 |
545 // Don't create this loop on iOS, since the outer loop is already handled | 549 // Don't create this loop on iOS, since the outer loop is already handled |
546 // and a loop that's destroyed in shutdown interleaves badly with the event | 550 // and a loop that's destroyed in shutdown interleaves badly with the event |
547 // loop pool on iOS. | 551 // loop pool on iOS. |
548 #if defined(OS_MACOSX) && !defined(OS_IOS) | 552 #if defined(OS_MACOSX) && !defined(OS_IOS) |
549 // We need this pool for all the objects created before we get to the | 553 // We need this pool for all the objects created before we get to the |
550 // event loop, but we don't want to leave them hanging around until the | 554 // event loop, but we don't want to leave them hanging around until the |
551 // app quits. Each "main" needs to flush this pool right before it goes into | 555 // app quits. Each "main" needs to flush this pool right before it goes into |
552 // its main event loop to get rid of the cruft. | 556 // its main event loop to get rid of the cruft. |
553 autorelease_pool_.reset(new base::mac::ScopedNSAutoreleasePool()); | 557 autorelease_pool_.reset(new base::mac::ScopedNSAutoreleasePool()); |
558 | |
559 // CoreAnimation has poor performance and CoreAnimation and | |
560 // non-CoreAnimation exhibit window flickering when layers are not hosted | |
561 // in the window server, which is the default when not not using the | |
562 // 10.9 SDK. | |
563 // TODO: Remove this when we build with the 10.9 SDK (or higher). | |
564 if (base::mac::IsOSMavericksOrLater()) { | |
565 base::ScopedCFTypeRef<CFStringRef> key(base::SysUTF8ToCFStringRef( | |
566 "NSWindowHostsLayersInWindowServer")); | |
567 base::ScopedCFTypeRef<CFStringRef> value(base::SysUTF8ToCFStringRef( | |
568 "YES")); | |
569 CFPreferencesSetAppValue( | |
570 key, value, kCFPreferencesCurrentApplication); | |
Avi (use Gerrit)
2015/05/07 19:54:44
CFPreferencesSetAppValue is different than -[NSUse
| |
571 } | |
554 #endif | 572 #endif |
555 | 573 |
556 // On Android, the command line is initialized when library is loaded and | 574 // On Android, the command line is initialized when library is loaded and |
557 // we have already started our TRACE_EVENT0. | 575 // we have already started our TRACE_EVENT0. |
558 #if !defined(OS_ANDROID) | 576 #if !defined(OS_ANDROID) |
559 // argc/argv are ignored on Windows and Android; see command_line.h for | 577 // argc/argv are ignored on Windows and Android; see command_line.h for |
560 // details. | 578 // details. |
561 int argc = 0; | 579 int argc = 0; |
562 const char** argv = NULL; | 580 const char** argv = NULL; |
563 | 581 |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
842 | 860 |
843 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 861 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
844 }; | 862 }; |
845 | 863 |
846 // static | 864 // static |
847 ContentMainRunner* ContentMainRunner::Create() { | 865 ContentMainRunner* ContentMainRunner::Create() { |
848 return new ContentMainRunnerImpl(); | 866 return new ContentMainRunnerImpl(); |
849 } | 867 } |
850 | 868 |
851 } // namespace content | 869 } // namespace content |
OLD | NEW |