| 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 <vector> | 10 #include <vector> |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 supported_types.end(), | 423 supported_types.end(), |
| 424 requested_type) != supported_types.end()) { | 424 requested_type) != supported_types.end()) { |
| 425 type = requested_type; | 425 type = requested_type; |
| 426 } else { | 426 } else { |
| 427 LOG(ERROR) << "Requested discardable memory type is not supported."; | 427 LOG(ERROR) << "Requested discardable memory type is not supported."; |
| 428 } | 428 } |
| 429 } | 429 } |
| 430 | 430 |
| 431 base::DiscardableMemory::SetPreferredType(type); | 431 base::DiscardableMemory::SetPreferredType(type); |
| 432 | 432 |
| 433 // Allow discardable memory implementations to register memory pressure | |
| 434 // listeners. | |
| 435 base::DiscardableMemory::RegisterMemoryPressureListeners(); | |
| 436 | |
| 437 // AllocateGpuMemoryBuffer must be used exclusively on one thread but | 433 // AllocateGpuMemoryBuffer must be used exclusively on one thread but |
| 438 // it doesn't have to be the same thread RenderThreadImpl is created on. | 434 // it doesn't have to be the same thread RenderThreadImpl is created on. |
| 439 allocate_gpu_memory_buffer_thread_checker_.DetachFromThread(); | 435 allocate_gpu_memory_buffer_thread_checker_.DetachFromThread(); |
| 440 | 436 |
| 441 TRACE_EVENT_END_ETW("RenderThreadImpl::Init", 0, ""); | 437 TRACE_EVENT_END_ETW("RenderThreadImpl::Init", 0, ""); |
| 442 } | 438 } |
| 443 | 439 |
| 444 RenderThreadImpl::~RenderThreadImpl() { | 440 RenderThreadImpl::~RenderThreadImpl() { |
| 445 } | 441 } |
| 446 | 442 |
| (...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1406 hidden_widget_count_--; | 1402 hidden_widget_count_--; |
| 1407 | 1403 |
| 1408 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1404 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
| 1409 return; | 1405 return; |
| 1410 } | 1406 } |
| 1411 | 1407 |
| 1412 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1408 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
| 1413 } | 1409 } |
| 1414 | 1410 |
| 1415 } // namespace content | 1411 } // namespace content |
| OLD | NEW |