| 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/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 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 AddFilter(devtools_agent_message_filter_.get()); | 1190 AddFilter(devtools_agent_message_filter_.get()); |
| 1191 | 1191 |
| 1192 if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1192 if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
| 1193 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1193 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
| 1194 } else { | 1194 } else { |
| 1195 // If we do not track widget visibility, then assume conservatively that | 1195 // If we do not track widget visibility, then assume conservatively that |
| 1196 // the isolate is in background. This reduces memory usage. | 1196 // the isolate is in background. This reduces memory usage. |
| 1197 isolate->IsolateInBackgroundNotification(); | 1197 isolate->IsolateInBackgroundNotification(); |
| 1198 } | 1198 } |
| 1199 | 1199 |
| 1200 renderer_scheduler_->SetTimerQueueSuspensionWhenBackgroundedEnabled( | |
| 1201 GetContentClient() | |
| 1202 ->renderer() | |
| 1203 ->AllowTimerSuspensionWhenProcessBackgrounded()); | |
| 1204 | |
| 1205 SkGraphics::SetResourceCacheSingleAllocationByteLimit( | 1200 SkGraphics::SetResourceCacheSingleAllocationByteLimit( |
| 1206 kImageCacheSingleAllocationByteLimit); | 1201 kImageCacheSingleAllocationByteLimit); |
| 1207 | 1202 |
| 1208 // Hook up blink's codecs so skia can call them | 1203 // Hook up blink's codecs so skia can call them |
| 1209 SkGraphics::SetImageGeneratorFromEncodedDataFactory( | 1204 SkGraphics::SetImageGeneratorFromEncodedDataFactory( |
| 1210 blink::WebImageGenerator::Create); | 1205 blink::WebImageGenerator::Create); |
| 1211 | 1206 |
| 1212 if (command_line.HasSwitch(switches::kMemoryMetrics)) { | 1207 if (command_line.HasSwitch(switches::kMemoryMetrics)) { |
| 1213 memory_observer_.reset(new MemoryObserver()); | 1208 memory_observer_.reset(new MemoryObserver()); |
| 1214 message_loop()->AddTaskObserver(memory_observer_.get()); | 1209 message_loop()->AddTaskObserver(memory_observer_.get()); |
| (...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2412 } | 2407 } |
| 2413 } | 2408 } |
| 2414 | 2409 |
| 2415 void RenderThreadImpl::OnRendererInterfaceRequest( | 2410 void RenderThreadImpl::OnRendererInterfaceRequest( |
| 2416 mojom::RendererAssociatedRequest request) { | 2411 mojom::RendererAssociatedRequest request) { |
| 2417 DCHECK(!renderer_binding_.is_bound()); | 2412 DCHECK(!renderer_binding_.is_bound()); |
| 2418 renderer_binding_.Bind(std::move(request)); | 2413 renderer_binding_.Bind(std::move(request)); |
| 2419 } | 2414 } |
| 2420 | 2415 |
| 2421 } // namespace content | 2416 } // namespace content |
| OLD | NEW |