Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 2914913002: [Mac] Enable AppNap for renderers (Closed)
Patch Set: Add comment for magic numbers Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/common/mac/app_nap_activity.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 #if defined(OS_ANDROID) 182 #if defined(OS_ANDROID)
183 #include <cpu-features.h> 183 #include <cpu-features.h>
184 #include "content/renderer/android/synchronous_compositor_filter.h" 184 #include "content/renderer/android/synchronous_compositor_filter.h"
185 #include "content/renderer/android/synchronous_compositor_frame_sink.h" 185 #include "content/renderer/android/synchronous_compositor_frame_sink.h"
186 #include "content/renderer/media/android/stream_texture_factory.h" 186 #include "content/renderer/media/android/stream_texture_factory.h"
187 #include "media/base/android/media_codec_util.h" 187 #include "media/base/android/media_codec_util.h"
188 #endif 188 #endif
189 189
190 #if defined(OS_MACOSX) 190 #if defined(OS_MACOSX)
191 #include "base/mac/mac_util.h" 191 #include "base/mac/mac_util.h"
192 #include "base/process/process.h"
193 #include "content/common/mac/app_nap_activity.h"
192 #include "content/renderer/theme_helper_mac.h" 194 #include "content/renderer/theme_helper_mac.h"
193 #include "content/renderer/webscrollbarbehavior_impl_mac.h" 195 #include "content/renderer/webscrollbarbehavior_impl_mac.h"
194 #endif 196 #endif
195 197
196 #if defined(OS_WIN) 198 #if defined(OS_WIN)
197 #include <windows.h> 199 #include <windows.h>
198 #include <objbase.h> 200 #include <objbase.h>
199 #endif 201 #endif
200 202
201 #if BUILDFLAG(ENABLE_WEBRTC) 203 #if BUILDFLAG(ENABLE_WEBRTC)
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 is_gpu_memory_buffer_compositor_resources_enabled_ = command_line.HasSwitch( 794 is_gpu_memory_buffer_compositor_resources_enabled_ = command_line.HasSwitch(
793 switches::kEnableGpuMemoryBufferCompositorResources); 795 switches::kEnableGpuMemoryBufferCompositorResources);
794 796
795 #if defined(OS_MACOSX) 797 #if defined(OS_MACOSX)
796 base::ScopedCFTypeRef<CFStringRef> key( 798 base::ScopedCFTypeRef<CFStringRef> key(
797 base::SysUTF8ToCFStringRef("NSScrollViewRubberbanding")); 799 base::SysUTF8ToCFStringRef("NSScrollViewRubberbanding"));
798 Boolean key_exists = false; 800 Boolean key_exists = false;
799 Boolean value = CFPreferencesGetAppBooleanValue( 801 Boolean value = CFPreferencesGetAppBooleanValue(
800 key, kCFPreferencesCurrentApplication, &key_exists); 802 key, kCFPreferencesCurrentApplication, &key_exists);
801 is_elastic_overscroll_enabled_ = !key_exists || value; 803 is_elastic_overscroll_enabled_ = !key_exists || value;
804
805 if (base::Process::IsAppNapEnabled()) {
806 AppNapActivity::InitializeAppNapSupport();
807 }
802 #else 808 #else
803 is_elastic_overscroll_enabled_ = false; 809 is_elastic_overscroll_enabled_ = false;
804 #endif 810 #endif
805 811
806 std::string image_texture_target_string = 812 std::string image_texture_target_string =
807 command_line.GetSwitchValueASCII(switches::kContentImageTextureTarget); 813 command_line.GetSwitchValueASCII(switches::kContentImageTextureTarget);
808 buffer_to_texture_target_map_ = 814 buffer_to_texture_target_map_ =
809 cc::StringToBufferToTextureTargetMap(image_texture_target_string); 815 cc::StringToBufferToTextureTargetMap(image_texture_target_string);
810 816
811 if (command_line.HasSwitch(switches::kDisableLCDText)) { 817 if (command_line.HasSwitch(switches::kDisableLCDText)) {
(...skipping 1679 matching lines...) Expand 10 before | Expand all | Expand 10 after
2491 } 2497 }
2492 } 2498 }
2493 2499
2494 void RenderThreadImpl::OnRendererInterfaceRequest( 2500 void RenderThreadImpl::OnRendererInterfaceRequest(
2495 mojom::RendererAssociatedRequest request) { 2501 mojom::RendererAssociatedRequest request) {
2496 DCHECK(!renderer_binding_.is_bound()); 2502 DCHECK(!renderer_binding_.is_bound());
2497 renderer_binding_.Bind(std::move(request)); 2503 renderer_binding_.Bind(std::move(request));
2498 } 2504 }
2499 2505
2500 } // namespace content 2506 } // namespace content
OLDNEW
« no previous file with comments | « content/common/mac/app_nap_activity.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698