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

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

Issue 782673002: MacViews: tryjobs for toolkit_views=1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 9 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 | « chrome/chrome_browser_ui.gypi ('k') | testing/buildbot/chromium.mac.json » ('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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 } 420 }
421 DCHECK(!item.offset()); 421 DCHECK(!item.offset());
422 scoped_ptr<DataElement> element(new DataElement()); 422 scoped_ptr<DataElement> element(new DataElement());
423 element->SetToBytes(item.bytes() + offset, 423 element->SetToBytes(item.bytes() + offset,
424 static_cast<int64>(new_length)); 424 static_cast<int64>(new_length));
425 memory_usage_ += new_length; 425 memory_usage_ += new_length;
426 target_blob_builder->AppendSharedBlobItem(new ShareableBlobDataItem( 426 target_blob_builder->AppendSharedBlobItem(new ShareableBlobDataItem(
427 target_blob_uuid, new BlobDataItem(element.Pass()))); 427 target_blob_uuid, new BlobDataItem(element.Pass())));
428 } break; 428 } break;
429 case DataElement::TYPE_FILE: { 429 case DataElement::TYPE_FILE: {
430 DCHECK_NE(item.length(), std::numeric_limits<uint64>::max()) 430 //DCHECK_NE(item.length(), std::numeric_limits<uint64>::max())
431 << "We cannot use a section of a file with an unknown length"; 431 // << "We cannot use a section of a file with an unknown length";
432 UMA_HISTOGRAM_COUNTS("Storage.BlobItemSize.BlobSlice.File", 432 UMA_HISTOGRAM_COUNTS("Storage.BlobItemSize.BlobSlice.File",
433 new_length / 1024); 433 new_length / 1024);
434 scoped_ptr<DataElement> element(new DataElement()); 434 scoped_ptr<DataElement> element(new DataElement());
435 element->SetToFilePathRange(item.path(), item.offset() + offset, 435 element->SetToFilePathRange(item.path(), item.offset() + offset,
436 new_length, 436 new_length,
437 item.expected_modification_time()); 437 item.expected_modification_time());
438 target_blob_builder->AppendSharedBlobItem(new ShareableBlobDataItem( 438 target_blob_builder->AppendSharedBlobItem(new ShareableBlobDataItem(
439 target_blob_uuid, 439 target_blob_uuid,
440 new BlobDataItem(element.Pass(), item.file_handle_))); 440 new BlobDataItem(element.Pass(), item.file_handle_)));
441 } break; 441 } break;
(...skipping 25 matching lines...) Expand all
467 if (found == blob_map_.end()) 467 if (found == blob_map_.end())
468 return false; 468 return false;
469 return found->second->IsBeingBuilt(); 469 return found->second->IsBeingBuilt();
470 } 470 }
471 471
472 bool BlobStorageContext::IsUrlRegistered(const GURL& blob_url) { 472 bool BlobStorageContext::IsUrlRegistered(const GURL& blob_url) {
473 return public_blob_urls_.find(blob_url) != public_blob_urls_.end(); 473 return public_blob_urls_.find(blob_url) != public_blob_urls_.end();
474 } 474 }
475 475
476 } // namespace storage 476 } // namespace storage
OLDNEW
« no previous file with comments | « chrome/chrome_browser_ui.gypi ('k') | testing/buildbot/chromium.mac.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698