Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: storage/browser/blob/blob_storage_context.cc

Issue 1376123002: Revert of [Blob] BlobReader class & tests, and removal of all redundant reading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « storage/browser/blob/blob_reader.cc ('k') | storage/browser/blob/blob_url_request_job.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 scoped_ptr<BlobDataHandle> BlobStorageContext::GetBlobDataFromUUID( 70 scoped_ptr<BlobDataHandle> BlobStorageContext::GetBlobDataFromUUID(
71 const std::string& uuid) { 71 const std::string& uuid) {
72 scoped_ptr<BlobDataHandle> result; 72 scoped_ptr<BlobDataHandle> result;
73 BlobMap::iterator found = blob_map_.find(uuid); 73 BlobMap::iterator found = blob_map_.find(uuid);
74 if (found == blob_map_.end()) 74 if (found == blob_map_.end())
75 return result.Pass(); 75 return result.Pass();
76 auto* entry = found->second; 76 auto* entry = found->second;
77 if (entry->flags & EXCEEDED_MEMORY) 77 if (entry->flags & EXCEEDED_MEMORY)
78 return result.Pass(); 78 return result.Pass();
79 DCHECK(!entry->IsBeingBuilt()); 79 DCHECK(!entry->IsBeingBuilt());
80 result.reset(new BlobDataHandle(uuid, entry->data->content_type(), 80 result.reset(
81 entry->data->content_disposition(), this, 81 new BlobDataHandle(uuid, this,
82 base::ThreadTaskRunnerHandle::Get().get())); 82 base::ThreadTaskRunnerHandle::Get().get()));
83 return result.Pass(); 83 return result.Pass();
84 } 84 }
85 85
86 scoped_ptr<BlobDataHandle> BlobStorageContext::GetBlobDataFromPublicURL( 86 scoped_ptr<BlobDataHandle> BlobStorageContext::GetBlobDataFromPublicURL(
87 const GURL& url) { 87 const GURL& url) {
88 BlobURLMap::iterator found = 88 BlobURLMap::iterator found =
89 public_blob_urls_.find(BlobUrlHasRef(url) ? ClearBlobUrlRef(url) : url); 89 public_blob_urls_.find(BlobUrlHasRef(url) ? ClearBlobUrlRef(url) : url);
90 if (found == public_blob_urls_.end()) 90 if (found == public_blob_urls_.end())
91 return scoped_ptr<BlobDataHandle>(); 91 return scoped_ptr<BlobDataHandle>();
92 return GetBlobDataFromUUID(found->second); 92 return GetBlobDataFromUUID(found->second);
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 if (found == blob_map_.end()) 491 if (found == blob_map_.end())
492 return false; 492 return false;
493 return found->second->IsBeingBuilt(); 493 return found->second->IsBeingBuilt();
494 } 494 }
495 495
496 bool BlobStorageContext::IsUrlRegistered(const GURL& blob_url) { 496 bool BlobStorageContext::IsUrlRegistered(const GURL& blob_url) {
497 return public_blob_urls_.find(blob_url) != public_blob_urls_.end(); 497 return public_blob_urls_.find(blob_url) != public_blob_urls_.end();
498 } 498 }
499 499
500 } // namespace storage 500 } // namespace storage
OLDNEW
« no previous file with comments | « storage/browser/blob/blob_reader.cc ('k') | storage/browser/blob/blob_url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698