Respond with QuotaExceededError when IndexedDB has no disk space on open.
[chromium-blink-merge.git] / content / common / gpu / gpu_memory_tracking.cc
blobe2d1fc7f8f06b3ec7da71e6688b9f04d08c6367b
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
3 // found in the LICENSE file.
5 #include "content/common/gpu/gpu_memory_tracking.h"
7 #include "content/common/gpu/gpu_memory_manager.h"
9 namespace content {
11 GpuMemoryTrackingGroup::GpuMemoryTrackingGroup(
12 base::ProcessId pid,
13 gpu::gles2::MemoryTracker* memory_tracker,
14 GpuMemoryManager* memory_manager)
15 : pid_(pid),
16 size_(0),
17 hibernated_(false),
18 memory_tracker_(memory_tracker),
19 memory_manager_(memory_manager) {
22 GpuMemoryTrackingGroup::~GpuMemoryTrackingGroup() {
23 memory_manager_->OnDestroyTrackingGroup(this);
26 void GpuMemoryTrackingGroup::TrackMemoryAllocatedChange(
27 uint64 old_size,
28 uint64 new_size,
29 gpu::gles2::MemoryTracker::Pool tracking_pool) {
30 memory_manager_->TrackMemoryAllocatedChange(
31 this, old_size, new_size, tracking_pool);
34 bool GpuMemoryTrackingGroup::EnsureGPUMemoryAvailable(uint64 size_needed) {
35 return memory_manager_->EnsureGPUMemoryAvailable(size_needed);
39 } // namespace content