| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser/gpu/shader_disk_cache.h" | 5 #include "content/browser/gpu/shader_disk_cache.h" |
| 6 | 6 |
| 7 #include "base/profiler/scoped_profile.h" | 7 #include "base/profiler/scoped_tracker.h" |
| 8 #include "base/threading/thread_checker.h" | 8 #include "base/threading/thread_checker.h" |
| 9 #include "content/browser/gpu/gpu_process_host.h" | 9 #include "content/browser/gpu/gpu_process_host.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| 11 #include "gpu/command_buffer/common/constants.h" | 11 #include "gpu/command_buffer/common/constants.h" |
| 12 #include "net/base/cache_type.h" | 12 #include "net/base/cache_type.h" |
| 13 #include "net/base/io_buffer.h" | 13 #include "net/base/io_buffer.h" |
| 14 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 } | 253 } |
| 254 | 254 |
| 255 void ShaderDiskReadHelper::LoadCache() { | 255 void ShaderDiskReadHelper::LoadCache() { |
| 256 DCHECK(CalledOnValidThread()); | 256 DCHECK(CalledOnValidThread()); |
| 257 if (!cache_.get()) | 257 if (!cache_.get()) |
| 258 return; | 258 return; |
| 259 OnOpComplete(net::OK); | 259 OnOpComplete(net::OK); |
| 260 } | 260 } |
| 261 | 261 |
| 262 void ShaderDiskReadHelper::OnOpComplete(int rv) { | 262 void ShaderDiskReadHelper::OnOpComplete(int rv) { |
| 263 // TODO(vadimt): Remove ScopedProfile below once crbug.com/422516 is fixed. | 263 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed. |
| 264 tracked_objects::ScopedProfile tracking_profile( | 264 tracked_objects::ScopedTracker tracking_profile( |
| 265 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 265 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 266 "422516 ShaderDiskReadHelper::OnOpComplete")); | 266 "422516 ShaderDiskReadHelper::OnOpComplete")); |
| 267 | 267 |
| 268 DCHECK(CalledOnValidThread()); | 268 DCHECK(CalledOnValidThread()); |
| 269 if (!cache_.get()) | 269 if (!cache_.get()) |
| 270 return; | 270 return; |
| 271 | 271 |
| 272 do { | 272 do { |
| 273 switch (op_type_) { | 273 switch (op_type_) { |
| 274 case OPEN_NEXT: | 274 case OPEN_NEXT: |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 const net::CompletionCallback& callback) { | 622 const net::CompletionCallback& callback) { |
| 623 if (entry_map_.empty()) { | 623 if (entry_map_.empty()) { |
| 624 return net::OK; | 624 return net::OK; |
| 625 } | 625 } |
| 626 cache_complete_callback_ = callback; | 626 cache_complete_callback_ = callback; |
| 627 return net::ERR_IO_PENDING; | 627 return net::ERR_IO_PENDING; |
| 628 } | 628 } |
| 629 | 629 |
| 630 } // namespace content | 630 } // namespace content |
| 631 | 631 |
| OLD | NEW |