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

Unified Diff: extensions/browser/api/copresence_endpoints/copresence_endpoints_api.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: extensions/browser/api/copresence_endpoints/copresence_endpoints_api.cc
diff --git a/extensions/browser/api/copresence_endpoints/copresence_endpoints_api.cc b/extensions/browser/api/copresence_endpoints/copresence_endpoints_api.cc
index f58c49b27d50eb9a203c2842ff125b46fe4e9771..6ecb7728cec13ac3e0f09d6f60faf9cc6ae84ead 100644
--- a/extensions/browser/api/copresence_endpoints/copresence_endpoints_api.cc
+++ b/extensions/browser/api/copresence_endpoints/copresence_endpoints_api.cc
@@ -50,12 +50,13 @@ std::string Base64EncodeWithoutPadding(const std::string& data) {
}
// Create a message to send to another endpoint.
-std::string CreateMessage(const std::string& data,
+std::string CreateMessage(const std::vector<char>& data,
const std::string& local_endpoint_locator,
int remote_endpoint_id) {
base::DictionaryValue dict;
dict.SetString(kToField, base::IntToString(remote_endpoint_id));
- dict.SetString(kDataField, Base64EncodeWithoutPadding(data));
+ dict.SetString(kDataField, Base64EncodeWithoutPadding(
+ std::string(data.begin(), data.end())));
dict.SetString(kReplyToField,
Base64EncodeWithoutPadding(local_endpoint_locator));
@@ -235,7 +236,7 @@ void CopresenceEndpointFunction::DispatchOnReceiveEvent(
core_api::copresence_endpoints::ReceiveInfo info;
info.local_endpoint_id = local_endpoint_id;
info.remote_endpoint_id = remote_endpoint_id;
- info.data = data;
+ info.data.assign(data.begin(), data.end());
// Send the data to the client app.
scoped_ptr<Event> event(
new Event(core_api::copresence_endpoints::OnReceive::kEventName,
« no previous file with comments | « extensions/browser/api/bluetooth_socket/bluetooth_socket_event_dispatcher.cc ('k') | extensions/browser/api/hid/hid_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698