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

Unified Diff: extensions/browser/api/socket/socket_api.cc

Issue 2799093006: Remove base::BinaryValue (Closed)
Patch Set: Rebase Created 3 years, 8 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
« no previous file with comments | « extensions/browser/api/hid/hid_api.cc ('k') | extensions/browser/api/usb/usb_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/socket/socket_api.cc
diff --git a/extensions/browser/api/socket/socket_api.cc b/extensions/browser/api/socket/socket_api.cc
index e64c2724337b7299e0e08cec75a2a2c6f0c60609..8a84f467b8579010b886a1b0a256df17605ed083 100644
--- a/extensions/browser/api/socket/socket_api.cc
+++ b/extensions/browser/api/socket/socket_api.cc
@@ -519,9 +519,8 @@ void SocketReadFunction::OnCompleted(int bytes_read,
std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
result->SetInteger(kResultCodeKey, bytes_read);
if (bytes_read > 0) {
- result->Set(kDataKey,
- base::BinaryValue::CreateWithCopiedBuffer(io_buffer->data(),
- bytes_read));
+ result->Set(kDataKey, base::Value::CreateWithCopiedBuffer(io_buffer->data(),
+ bytes_read));
} else {
result->Set(kDataKey, new base::Value(base::Value::Type::BINARY));
}
@@ -537,7 +536,7 @@ SocketWriteFunction::~SocketWriteFunction() {}
bool SocketWriteFunction::Prepare() {
EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &socket_id_));
- base::BinaryValue* data = NULL;
+ base::Value* data = NULL;
EXTENSION_FUNCTION_VALIDATE(args_->GetBinary(1, &data));
io_buffer_size_ = data->GetSize();
@@ -597,9 +596,8 @@ void SocketRecvFromFunction::OnCompleted(int bytes_read,
std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
result->SetInteger(kResultCodeKey, bytes_read);
if (bytes_read > 0) {
- result->Set(kDataKey,
- base::BinaryValue::CreateWithCopiedBuffer(io_buffer->data(),
- bytes_read));
+ result->Set(kDataKey, base::Value::CreateWithCopiedBuffer(io_buffer->data(),
+ bytes_read));
} else {
result->Set(kDataKey, new base::Value(base::Value::Type::BINARY));
}
@@ -618,7 +616,7 @@ SocketSendToFunction::~SocketSendToFunction() {}
bool SocketSendToFunction::Prepare() {
EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &socket_id_));
- base::BinaryValue* data = NULL;
+ base::Value* data = NULL;
EXTENSION_FUNCTION_VALIDATE(args_->GetBinary(1, &data));
EXTENSION_FUNCTION_VALIDATE(args_->GetString(2, &hostname_));
int port;
« no previous file with comments | « extensions/browser/api/hid/hid_api.cc ('k') | extensions/browser/api/usb/usb_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698