| 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 "base/bind.h" | 7 #include "base/bind.h" | 
| 8 #include "base/location.h" | 8 #include "base/location.h" | 
| 9 #include "base/logging.h" | 9 #include "base/logging.h" | 
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" | 
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 195 } | 195 } | 
| 196 | 196 | 
| 197 void BlobStorageContext::FinishBuildingBlob( | 197 void BlobStorageContext::FinishBuildingBlob( | 
| 198     const std::string& uuid, const std::string& content_type) { | 198     const std::string& uuid, const std::string& content_type) { | 
| 199   DCHECK(IsBeingBuilt(uuid)); | 199   DCHECK(IsBeingBuilt(uuid)); | 
| 200   BlobMap::iterator found = blob_map_.find(uuid); | 200   BlobMap::iterator found = blob_map_.find(uuid); | 
| 201   if (found == blob_map_.end()) | 201   if (found == blob_map_.end()) | 
| 202     return; | 202     return; | 
| 203   found->second.data->set_content_type(content_type); | 203   found->second.data->set_content_type(content_type); | 
| 204   found->second.flags &= ~BEING_BUILT; | 204   found->second.flags &= ~BEING_BUILT; | 
|  | 205   UMA_HISTOGRAM_COUNTS("Storage.Blob.ItemCount", | 
|  | 206                        found->second.data->items().size()); | 
| 205   UMA_HISTOGRAM_BOOLEAN( | 207   UMA_HISTOGRAM_BOOLEAN( | 
| 206       "Storage.Blob.ExceededMemory", | 208       "Storage.Blob.ExceededMemory", | 
| 207       (found->second.flags & EXCEEDED_MEMORY) == EXCEEDED_MEMORY); | 209       (found->second.flags & EXCEEDED_MEMORY) == EXCEEDED_MEMORY); | 
| 208 } | 210 } | 
| 209 | 211 | 
| 210 void BlobStorageContext::CancelBuildingBlob(const std::string& uuid) { | 212 void BlobStorageContext::CancelBuildingBlob(const std::string& uuid) { | 
| 211   DCHECK(IsBeingBuilt(uuid)); | 213   DCHECK(IsBeingBuilt(uuid)); | 
| 212   DecrementBlobRefCount(uuid); | 214   DecrementBlobRefCount(uuid); | 
| 213 } | 215 } | 
| 214 | 216 | 
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 323   if (found == blob_map_.end()) | 325   if (found == blob_map_.end()) | 
| 324     return false; | 326     return false; | 
| 325   return found->second.flags & BEING_BUILT; | 327   return found->second.flags & BEING_BUILT; | 
| 326 } | 328 } | 
| 327 | 329 | 
| 328 bool BlobStorageContext::IsUrlRegistered(const GURL& blob_url) { | 330 bool BlobStorageContext::IsUrlRegistered(const GURL& blob_url) { | 
| 329   return public_blob_urls_.find(blob_url) != public_blob_urls_.end(); | 331   return public_blob_urls_.find(blob_url) != public_blob_urls_.end(); | 
| 330 } | 332 } | 
| 331 | 333 | 
| 332 }  // namespace storage | 334 }  // namespace storage | 
| OLD | NEW | 
|---|