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

Unified Diff: gpu/command_buffer/client/mapped_memory.cc

Issue 1900993002: Move SharedMemoryLimits out of WebGraphicsContext3DCommandBufferImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@limits
Patch Set: move-limits: types Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/client/mapped_memory.cc
diff --git a/gpu/command_buffer/client/mapped_memory.cc b/gpu/command_buffer/client/mapped_memory.cc
index cd1ff41fa4e7f81828317b8219128765c2df9c5d..69ed174387f9df2cd683706ce71929cc8b19766b 100644
--- a/gpu/command_buffer/client/mapped_memory.cc
+++ b/gpu/command_buffer/client/mapped_memory.cc
@@ -18,6 +18,7 @@
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/trace_event.h"
#include "gpu/command_buffer/client/cmd_buffer_helper.h"
+#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "gpu/command_buffer/common/buffer.h"
namespace gpu {
@@ -44,7 +45,7 @@ MappedMemoryManager::MappedMemoryManager(CommandBufferHelper* helper,
helper_(helper),
allocated_memory_(0),
max_free_bytes_(unused_memory_reclaim_limit),
- max_allocated_bytes_(kNoLimit),
+ max_allocated_bytes_(SharedMemoryLimits::kNoLimit),
tracing_id_(g_next_mapped_memory_manager_tracing_id.GetNext()) {
// In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview).
// Don't register a dump provider in these cases.
@@ -88,7 +89,7 @@ void* MappedMemoryManager::Alloc(unsigned int size,
// If there is a memory limit being enforced and total free
// memory (allocated_memory_ - total_bytes_in_use) is larger than
// the limit try waiting.
- if (max_free_bytes_ != kNoLimit &&
+ if (max_free_bytes_ != SharedMemoryLimits::kNoLimit &&
(allocated_memory_ - total_bytes_in_use) >= max_free_bytes_) {
TRACE_EVENT0("gpu", "MappedMemoryManager::Alloc::wait");
for (auto& chunk : chunks_) {
@@ -103,7 +104,7 @@ void* MappedMemoryManager::Alloc(unsigned int size,
}
}
- if (max_allocated_bytes_ != kNoLimit &&
+ if (max_allocated_bytes_ != SharedMemoryLimits::kNoLimit &&
(allocated_memory_ + size) > max_allocated_bytes_) {
return nullptr;
}
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_unittest.cc ('k') | gpu/command_buffer/client/shared_memory_limits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698