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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
Index: storage/common/blob_storage/blob_item_bytes_response.cc
diff --git a/storage/common/blob_storage/blob_item_bytes_response.cc b/storage/common/blob_storage/blob_item_bytes_response.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ccb25981d89c07ffdb3d5b63b455d5190468e1d5
--- /dev/null
+++ b/storage/common/blob_storage/blob_item_bytes_response.cc
@@ -0,0 +1,39 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "storage/common/blob_storage/blob_item_bytes_response.h"
+
+#include <algorithm>
+#include <string>
+
+#include "base/strings/string_number_conversions.h"
+
+namespace storage {
+
+BlobItemBytesResponse::BlobItemBytesResponse()
+ : request_number(kInvalidIndex) {}
+
+BlobItemBytesResponse::BlobItemBytesResponse(size_t request_number)
+ : request_number(request_number) {}
+
+BlobItemBytesResponse::~BlobItemBytesResponse() {}
+
+void PrintTo(const BlobItemBytesResponse& response, ::std::ostream* os) {
+ const size_t kMaxDataPrintLength = 40;
+ size_t length = std::min(response.inline_data.size(), kMaxDataPrintLength);
+ *os << "{request_number: " << response.request_number
+ << ", inline_data size: " << response.inline_data.size()
+ << ", inline_data: [";
+ if (length == 0) {
+ *os << "<empty>";
+ } else {
+ *os << base::HexEncode(&response.inline_data[0], length);
+ if (length < response.inline_data.size()) {
+ *os << "<...truncated due to length...>";
+ }
+ }
+ *os << "]}";
+}
+
+} // namespace storage
« 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