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

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

Issue 1288373002: [BlobAsync] Patch 2: Common Constants (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async1
Patch Set: comments Created 5 years, 1 month 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "storage/common/blob_storage/blob_item_bytes_response.h"
6
7 #include <algorithm>
8 #include <string>
9
10 #include "base/strings/string_number_conversions.h"
11
12 namespace storage {
13
14 BlobItemBytesResponse::BlobItemBytesResponse()
15 : request_number(kInvalidIndex) {}
16
17 BlobItemBytesResponse::BlobItemBytesResponse(size_t request_number)
18 : request_number(request_number) {}
19
20 BlobItemBytesResponse::~BlobItemBytesResponse() {}
21
22 void PrintTo(const BlobItemBytesResponse& response, ::std::ostream* os) {
23 const size_t kMaxDataPrintLength = 40;
24 size_t length = std::min(response.inline_data.size(), kMaxDataPrintLength);
25 *os << "{request_number: " << response.request_number
26 << ", inline_data size: " << response.inline_data.size()
27 << ", inline_data: [";
28 if (length == 0) {
29 *os << "<empty>";
30 } else {
31 *os << base::HexEncode(&response.inline_data[0], length);
32 if (length < response.inline_data.size()) {
33 *os << "<...truncated due to length...>";
34 }
35 }
36 *os << "]}";
37 }
38
39 } // namespace storage
OLDNEW
« no previous file with comments | « storage/common/blob_storage/blob_item_bytes_response.h ('k') | storage/common/blob_storage/blob_storage_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698