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 } | |
52 | 40 |
53 BlobEntry::BlobEntry(const std::string& content_type, | 41 BlobEntry::BlobEntry(const std::string& content_type, |
54 const std::string& content_disposition) | 42 const std::string& content_disposition) |
55 : content_type_(content_type), content_disposition_(content_disposition) {} | 43 : content_type_(content_type), content_disposition_(content_disposition) {} |
56 BlobEntry::~BlobEntry() {} | 44 BlobEntry::~BlobEntry() {} |
57 | 45 |
58 void BlobEntry::AppendSharedBlobItem( | 46 void BlobEntry::AppendSharedBlobItem( |
59 scoped_refptr<ShareableBlobDataItem> item) { | 47 scoped_refptr<ShareableBlobDataItem> item) { |
60 DCHECK(item); | 48 DCHECK(item); |
61 if (!items_.empty()) { | 49 if (!items_.empty()) { |
(...skipping 10 matching lines...) Expand all Loading... |
72 | 60 |
73 void BlobEntry::ClearItems() { | 61 void BlobEntry::ClearItems() { |
74 items_.clear(); | 62 items_.clear(); |
75 } | 63 } |
76 | 64 |
77 void BlobEntry::ClearOffsets() { | 65 void BlobEntry::ClearOffsets() { |
78 offsets_.clear(); | 66 offsets_.clear(); |
79 } | 67 } |
80 | 68 |
81 } // namespace storage | 69 } // namespace storage |
OLD | NEW |