| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/cache_storage/cache_storage_dispatcher_host.h" | 5 #include "content/browser/cache_storage/cache_storage_dispatcher_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 } | 64 } |
| 65 | 65 |
| 66 CacheStorageDispatcherHost::~CacheStorageDispatcherHost() { | 66 CacheStorageDispatcherHost::~CacheStorageDispatcherHost() { |
| 67 } | 67 } |
| 68 | 68 |
| 69 void CacheStorageDispatcherHost::Init(CacheStorageContextImpl* context) { | 69 void CacheStorageDispatcherHost::Init(CacheStorageContextImpl* context) { |
| 70 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 70 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 71 BrowserThread::PostTask( | 71 BrowserThread::PostTask( |
| 72 BrowserThread::IO, FROM_HERE, | 72 BrowserThread::IO, FROM_HERE, |
| 73 base::Bind(&CacheStorageDispatcherHost::CreateCacheListener, this, | 73 base::Bind(&CacheStorageDispatcherHost::CreateCacheListener, this, |
| 74 make_scoped_refptr(context))); | 74 base::RetainedRef(context))); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void CacheStorageDispatcherHost::OnDestruct() const { | 77 void CacheStorageDispatcherHost::OnDestruct() const { |
| 78 BrowserThread::DeleteOnIOThread::Destruct(this); | 78 BrowserThread::DeleteOnIOThread::Destruct(this); |
| 79 } | 79 } |
| 80 | 80 |
| 81 bool CacheStorageDispatcherHost::OnMessageReceived( | 81 bool CacheStorageDispatcherHost::OnMessageReceived( |
| 82 const IPC::Message& message) { | 82 const IPC::Message& message) { |
| 83 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 83 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 84 | 84 |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 UUIDToBlobDataHandleList::iterator it = blob_handle_store_.find(uuid); | 519 UUIDToBlobDataHandleList::iterator it = blob_handle_store_.find(uuid); |
| 520 if (it == blob_handle_store_.end()) | 520 if (it == blob_handle_store_.end()) |
| 521 return; | 521 return; |
| 522 DCHECK(!it->second.empty()); | 522 DCHECK(!it->second.empty()); |
| 523 it->second.pop_front(); | 523 it->second.pop_front(); |
| 524 if (it->second.empty()) | 524 if (it->second.empty()) |
| 525 blob_handle_store_.erase(it); | 525 blob_handle_store_.erase(it); |
| 526 } | 526 } |
| 527 | 527 |
| 528 } // namespace content | 528 } // namespace content |
| OLD | NEW |