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

Side by Side Diff: webkit/browser/blob/blob_storage_controller.cc

Issue 17948002: Update Linux to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
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/browser/blob/blob_storage_controller.h" 5 #include "webkit/browser/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/common/blob/blob_data.h" 9 #include "webkit/common/blob/blob_data.h"
10 10
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 if (DecrementBlobDataUsage(found->second.get())) 166 if (DecrementBlobDataUsage(found->second.get()))
167 memory_usage_ -= found->second->GetMemoryUsage(); 167 memory_usage_ -= found->second->GetMemoryUsage();
168 map->erase(found); 168 map->erase(found);
169 return true; 169 return true;
170 } 170 }
171 171
172 172
173 BlobData* BlobStorageController::GetBlobDataFromUrl(const GURL& url) { 173 BlobData* BlobStorageController::GetBlobDataFromUrl(const GURL& url) {
174 BlobMap::iterator found = blob_map_.find( 174 BlobMap::iterator found = blob_map_.find(
175 BlobUrlHasRef(url) ? ClearBlobUrlRef(url).spec() : url.spec()); 175 BlobUrlHasRef(url) ? ClearBlobUrlRef(url).spec() : url.spec());
176 return (found != blob_map_.end()) ? found->second : NULL; 176 return (found != blob_map_.end()) ? found->second.get() : NULL;
177 } 177 }
178 178
179 void BlobStorageController::AppendStorageItems( 179 void BlobStorageController::AppendStorageItems(
180 BlobData* target_blob_data, BlobData* src_blob_data, 180 BlobData* target_blob_data, BlobData* src_blob_data,
181 uint64 offset, uint64 length) { 181 uint64 offset, uint64 length) {
182 DCHECK(target_blob_data && src_blob_data && 182 DCHECK(target_blob_data && src_blob_data &&
183 length != static_cast<uint64>(-1)); 183 length != static_cast<uint64>(-1));
184 184
185 std::vector<BlobData::Item>::const_iterator iter = 185 std::vector<BlobData::Item>::const_iterator iter =
186 src_blob_data->items().begin(); 186 src_blob_data->items().begin();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 bool BlobStorageController::DecrementBlobDataUsage(BlobData* blob_data) { 248 bool BlobStorageController::DecrementBlobDataUsage(BlobData* blob_data) {
249 BlobDataUsageMap::iterator found = blob_data_usage_count_.find(blob_data); 249 BlobDataUsageMap::iterator found = blob_data_usage_count_.find(blob_data);
250 DCHECK(found != blob_data_usage_count_.end()); 250 DCHECK(found != blob_data_usage_count_.end());
251 if (--(found->second)) 251 if (--(found->second))
252 return false; // Still in use 252 return false; // Still in use
253 blob_data_usage_count_.erase(found); 253 blob_data_usage_count_.erase(found);
254 return true; 254 return true;
255 } 255 }
256 256
257 } // namespace webkit_blob 257 } // namespace webkit_blob
OLDNEW
« no previous file with comments | « webkit/browser/appcache/appcache_url_request_job.cc ('k') | webkit/browser/fileapi/async_file_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698