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

Unified Diff: chrome/browser/extensions/api/copresence/copresence_translations.cc

Issue 820673004: json_schema_compiler: Use std::vector<char> for binary values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simplify_json_schema
Patch Set: Fix merge error. Created 5 years, 11 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: chrome/browser/extensions/api/copresence/copresence_translations.cc
diff --git a/chrome/browser/extensions/api/copresence/copresence_translations.cc b/chrome/browser/extensions/api/copresence/copresence_translations.cc
index 77a0d9f3a68e4affc10e0df5544f8d97fb11ebfc..492e6c2b5b32d9f9540346556cd0561062fb2929 100644
--- a/chrome/browser/extensions/api/copresence/copresence_translations.cc
+++ b/chrome/browser/extensions/api/copresence/copresence_translations.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/extensions/api/copresence/copresence_translations.h"
+#include "base/stl_util.h"
#include "chrome/common/extensions/api/copresence.h"
#include "components/copresence/proto/data.pb.h"
#include "components/copresence/proto/enums.pb.h"
@@ -89,7 +90,9 @@ bool AddPublishToRequest(const std::string& app_id,
publish_proto->set_id(publish.id);
publish_proto->mutable_message()->mutable_type()->set_type(
publish.message.type);
- publish_proto->mutable_message()->set_payload(publish.message.payload);
+ publish_proto->mutable_message()->set_payload(
+ vector_as_array(&publish.message.payload),
+ publish.message.payload.size());
int ttl = SanitizeTtl(publish.time_to_live_millis.get());
if (ttl < 0)
@@ -101,7 +104,8 @@ bool AddPublishToRequest(const std::string& app_id,
publish_proto->mutable_token_exchange_strategy());
DVLOG(2) << "Publishing message of type " << publish.message.type << ":\n"
- << publish.message.payload;
+ << std::string(publish.message.payload.begin(),
+ publish.message.payload.end());
// TODO(ckehoe): Validate that required fields are non-empty, etc.
return true;
}

Powered by Google App Engine
This is Rietveld 408576698