OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/blob/blob_storage_controller.h" | 5 #include "webkit/blob/blob_storage_controller.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
9 #include "webkit/blob/blob_data.h" | 9 #include "webkit/blob/blob_data.h" |
10 | 10 |
| 11 error error error |
| 12 replaced by BlobStorageContext class |
| 13 |
11 namespace webkit_blob { | 14 namespace webkit_blob { |
12 | 15 |
13 namespace { | 16 namespace { |
14 | 17 |
15 // We can't use GURL directly for these hash fragment manipulations | 18 // We can't use GURL directly for these hash fragment manipulations |
16 // since it doesn't have specific knowlege of the BlobURL format. GURL | 19 // since it doesn't have specific knowlege of the BlobURL format. GURL |
17 // treats BlobURLs as if they were PathURLs which don't support hash | 20 // treats BlobURLs as if they were PathURLs which don't support hash |
18 // fragments. | 21 // fragments. |
19 | 22 |
20 bool BlobUrlHasRef(const GURL& url) { | 23 bool BlobUrlHasRef(const GURL& url) { |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 bool BlobStorageController::DecrementBlobDataUsage(BlobData* blob_data) { | 245 bool BlobStorageController::DecrementBlobDataUsage(BlobData* blob_data) { |
243 BlobDataUsageMap::iterator found = blob_data_usage_count_.find(blob_data); | 246 BlobDataUsageMap::iterator found = blob_data_usage_count_.find(blob_data); |
244 DCHECK(found != blob_data_usage_count_.end()); | 247 DCHECK(found != blob_data_usage_count_.end()); |
245 if (--(found->second)) | 248 if (--(found->second)) |
246 return false; // Still in use | 249 return false; // Still in use |
247 blob_data_usage_count_.erase(found); | 250 blob_data_usage_count_.erase(found); |
248 return true; | 251 return true; |
249 } | 252 } |
250 | 253 |
251 } // namespace webkit_blob | 254 } // namespace webkit_blob |
OLD | NEW |