| 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "storage/browser/blob/blob_data_handle.h" | 10 #include "storage/browser/blob/blob_data_handle.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 BlobEntry::ItemCopyEntry::~ItemCopyEntry() {} | 29 BlobEntry::ItemCopyEntry::~ItemCopyEntry() {} |
| 30 | 30 |
| 31 BlobEntry::BuildingState::BuildingState( | 31 BlobEntry::BuildingState::BuildingState( |
| 32 bool transport_items_present, | 32 bool transport_items_present, |
| 33 TransportAllowedCallback transport_allowed_callback, | 33 TransportAllowedCallback transport_allowed_callback, |
| 34 size_t num_building_dependent_blobs) | 34 size_t num_building_dependent_blobs) |
| 35 : transport_items_present(transport_items_present), | 35 : transport_items_present(transport_items_present), |
| 36 transport_allowed_callback(transport_allowed_callback), | 36 transport_allowed_callback(transport_allowed_callback), |
| 37 num_building_dependent_blobs(num_building_dependent_blobs) {} | 37 num_building_dependent_blobs(num_building_dependent_blobs) {} |
| 38 | 38 |
| 39 BlobEntry::BuildingState::~BuildingState() {} | 39 BlobEntry::BuildingState::~BuildingState() { |
| 40 DCHECK(!copy_quota_request); |
| 41 DCHECK(!transport_quota_request); |
| 42 } |
| 43 |
| 44 void BlobEntry::BuildingState::CancelRequests() { |
| 45 if (copy_quota_request) { |
| 46 copy_quota_request->Cancel(); |
| 47 } |
| 48 if (transport_quota_request) { |
| 49 transport_quota_request->Cancel(); |
| 50 } |
| 51 } |
| 40 | 52 |
| 41 BlobEntry::BlobEntry(const std::string& content_type, | 53 BlobEntry::BlobEntry(const std::string& content_type, |
| 42 const std::string& content_disposition) | 54 const std::string& content_disposition) |
| 43 : content_type_(content_type), content_disposition_(content_disposition) {} | 55 : content_type_(content_type), content_disposition_(content_disposition) {} |
| 44 BlobEntry::~BlobEntry() {} | 56 BlobEntry::~BlobEntry() {} |
| 45 | 57 |
| 46 void BlobEntry::AppendSharedBlobItem( | 58 void BlobEntry::AppendSharedBlobItem( |
| 47 scoped_refptr<ShareableBlobDataItem> item) { | 59 scoped_refptr<ShareableBlobDataItem> item) { |
| 48 DCHECK(item); | 60 DCHECK(item); |
| 49 if (!items_.empty()) { | 61 if (!items_.empty()) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 60 | 72 |
| 61 void BlobEntry::ClearItems() { | 73 void BlobEntry::ClearItems() { |
| 62 items_.clear(); | 74 items_.clear(); |
| 63 } | 75 } |
| 64 | 76 |
| 65 void BlobEntry::ClearOffsets() { | 77 void BlobEntry::ClearOffsets() { |
| 66 offsets_.clear(); | 78 offsets_.clear(); |
| 67 } | 79 } |
| 68 | 80 |
| 69 } // namespace storage | 81 } // namespace storage |
| OLD | NEW |