| 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 "webkit/browser/blob/blob_storage_context.h" | 5 #include "webkit/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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 scoped_ptr<BlobDataHandle> BlobStorageContext::GetBlobDataFromUUID( | 60 scoped_ptr<BlobDataHandle> BlobStorageContext::GetBlobDataFromUUID( |
| 61 const std::string& uuid) { | 61 const std::string& uuid) { |
| 62 scoped_ptr<BlobDataHandle> result; | 62 scoped_ptr<BlobDataHandle> result; |
| 63 BlobMap::iterator found = blob_map_.find(uuid); | 63 BlobMap::iterator found = blob_map_.find(uuid); |
| 64 if (found == blob_map_.end()) | 64 if (found == blob_map_.end()) |
| 65 return result.Pass(); | 65 return result.Pass(); |
| 66 if (found->second.flags & EXCEEDED_MEMORY) | 66 if (found->second.flags & EXCEEDED_MEMORY) |
| 67 return result.Pass(); | 67 return result.Pass(); |
| 68 DCHECK(!(found->second.flags & BEING_BUILT)); | 68 DCHECK(!(found->second.flags & BEING_BUILT)); |
| 69 result.reset(new BlobDataHandle( | 69 result.reset(new BlobDataHandle( |
| 70 found->second.data.get(), this, base::MessageLoopProxy::current())); | 70 found->second.data.get(), this, base::MessageLoopProxy::current().get())); |
| 71 return result.Pass(); | 71 return result.Pass(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 scoped_ptr<BlobDataHandle> BlobStorageContext::GetBlobDataFromPublicURL( | 74 scoped_ptr<BlobDataHandle> BlobStorageContext::GetBlobDataFromPublicURL( |
| 75 const GURL& url) { | 75 const GURL& url) { |
| 76 BlobURLMap::iterator found = public_blob_urls_.find( | 76 BlobURLMap::iterator found = public_blob_urls_.find( |
| 77 BlobUrlHasRef(url) ? ClearBlobUrlRef(url) : url); | 77 BlobUrlHasRef(url) ? ClearBlobUrlRef(url) : url); |
| 78 if (found == public_blob_urls_.end()) | 78 if (found == public_blob_urls_.end()) |
| 79 return scoped_ptr<BlobDataHandle>(); | 79 return scoped_ptr<BlobDataHandle>(); |
| 80 return GetBlobDataFromUUID(found->second); | 80 return GetBlobDataFromUUID(found->second); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 if (found == blob_map_.end()) | 313 if (found == blob_map_.end()) |
| 314 return false; | 314 return false; |
| 315 return found->second.flags & BEING_BUILT; | 315 return found->second.flags & BEING_BUILT; |
| 316 } | 316 } |
| 317 | 317 |
| 318 bool BlobStorageContext::IsUrlRegistered(const GURL& blob_url) { | 318 bool BlobStorageContext::IsUrlRegistered(const GURL& blob_url) { |
| 319 return public_blob_urls_.find(blob_url) != public_blob_urls_.end(); | 319 return public_blob_urls_.find(blob_url) != public_blob_urls_.end(); |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace webkit_blob | 322 } // namespace webkit_blob |
| OLD | NEW |