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 "storage/browser/blob/blob_storage_context.h" | 5 #include "storage/browser/blob/blob_storage_context.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <limits> | 10 #include <limits> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 BlobStorageContext::BlobMapEntry::BlobMapEntry(int refcount, | 54 BlobStorageContext::BlobMapEntry::BlobMapEntry(int refcount, |
55 InternalBlobData::Builder* data) | 55 InternalBlobData::Builder* data) |
56 : refcount(refcount), flags(0), data_builder(data) { | 56 : refcount(refcount), flags(0), data_builder(data) { |
57 } | 57 } |
58 | 58 |
59 BlobStorageContext::BlobMapEntry::~BlobMapEntry() { | 59 BlobStorageContext::BlobMapEntry::~BlobMapEntry() { |
60 } | 60 } |
61 | 61 |
62 bool BlobStorageContext::BlobMapEntry::IsBeingBuilt() { | 62 bool BlobStorageContext::BlobMapEntry::IsBeingBuilt() { |
63 return data_builder; | 63 return !!data_builder; |
64 } | 64 } |
65 | 65 |
66 BlobStorageContext::BlobStorageContext() : memory_usage_(0) { | 66 BlobStorageContext::BlobStorageContext() : memory_usage_(0) { |
67 } | 67 } |
68 | 68 |
69 BlobStorageContext::~BlobStorageContext() { | 69 BlobStorageContext::~BlobStorageContext() { |
70 STLDeleteContainerPairSecondPointers(blob_map_.begin(), blob_map_.end()); | 70 STLDeleteContainerPairSecondPointers(blob_map_.begin(), blob_map_.end()); |
71 } | 71 } |
72 | 72 |
73 scoped_ptr<BlobDataHandle> BlobStorageContext::GetBlobDataFromUUID( | 73 scoped_ptr<BlobDataHandle> BlobStorageContext::GetBlobDataFromUUID( |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 if (found == blob_map_.end()) | 500 if (found == blob_map_.end()) |
501 return false; | 501 return false; |
502 return found->second->IsBeingBuilt(); | 502 return found->second->IsBeingBuilt(); |
503 } | 503 } |
504 | 504 |
505 bool BlobStorageContext::IsUrlRegistered(const GURL& blob_url) { | 505 bool BlobStorageContext::IsUrlRegistered(const GURL& blob_url) { |
506 return public_blob_urls_.find(blob_url) != public_blob_urls_.end(); | 506 return public_blob_urls_.find(blob_url) != public_blob_urls_.end(); |
507 } | 507 } |
508 | 508 |
509 } // namespace storage | 509 } // namespace storage |
OLD | NEW |