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

Side by Side Diff: storage/common/blob_storage/blob_item_bytes_response.cc

Issue 1234813004: [BlobAsync] Asynchronous Blob Construction Final Patch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blob-protocol-change
Patch Set: added shared memory test, and fixed memory leak Created 4 years, 10 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/common/blob_storage/blob_item_bytes_response.h" 5 #include "storage/common/blob_storage/blob_item_bytes_response.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
11 11
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 13
14 namespace storage { 14 namespace storage {
15 15
16 BlobItemBytesResponse::BlobItemBytesResponse() 16 BlobItemBytesResponse::BlobItemBytesResponse()
17 : request_number(kInvalidIndex) {} 17 : request_number(kInvalidIndex) {}
18 18
19 BlobItemBytesResponse::BlobItemBytesResponse(size_t request_number) 19 BlobItemBytesResponse::BlobItemBytesResponse(uint32_t request_number)
20 : request_number(request_number) {} 20 : request_number(request_number) {}
21 21
22 BlobItemBytesResponse::~BlobItemBytesResponse() {} 22 BlobItemBytesResponse::~BlobItemBytesResponse() {}
23 23
24 void PrintTo(const BlobItemBytesResponse& response, ::std::ostream* os) { 24 void PrintTo(const BlobItemBytesResponse& response, ::std::ostream* os) {
25 const size_t kMaxDataPrintLength = 40; 25 const size_t kMaxDataPrintLength = 40;
26 size_t length = std::min(response.inline_data.size(), kMaxDataPrintLength); 26 size_t length = std::min(response.inline_data.size(), kMaxDataPrintLength);
27 *os << "{request_number: " << response.request_number 27 *os << "{request_number: " << response.request_number
28 << ", inline_data size: " << response.inline_data.size() 28 << ", inline_data size: " << response.inline_data.size()
29 << ", inline_data: ["; 29 << ", inline_data: [";
(...skipping 16 matching lines...) Expand all
46 a.inline_data.begin() + a.inline_data.size(), 46 a.inline_data.begin() + a.inline_data.size(),
47 b.inline_data.begin()); 47 b.inline_data.begin());
48 } 48 }
49 49
50 bool operator!=(const BlobItemBytesResponse& a, 50 bool operator!=(const BlobItemBytesResponse& a,
51 const BlobItemBytesResponse& b) { 51 const BlobItemBytesResponse& b) {
52 return !(a == b); 52 return !(a == b);
53 } 53 }
54 54
55 } // namespace storage 55 } // namespace storage
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698