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

Unified Diff: content/common/android/gin_java_bridge_value.cc

Issue 2689673002: Inline base::BinaryValue into base::Value (Closed)
Patch Set: Rebase Created 3 years, 10 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 | « content/child/v8_value_converter_impl.cc ('k') | extensions/browser/api/cast_channel/cast_channel_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/android/gin_java_bridge_value.cc
diff --git a/content/common/android/gin_java_bridge_value.cc b/content/common/android/gin_java_bridge_value.cc
index 5961461457ef6ce9222313b6b8cc00bcad7ada7f..ed3fd7e4c7ba81947c944d87b2a45bc280a0e98f 100644
--- a/content/common/android/gin_java_bridge_value.cc
+++ b/content/common/android/gin_java_bridge_value.cc
@@ -57,11 +57,9 @@ std::unique_ptr<base::BinaryValue> GinJavaBridgeValue::CreateObjectIDValue(
bool GinJavaBridgeValue::ContainsGinJavaBridgeValue(const base::Value* value) {
if (!value->IsType(base::Value::Type::BINARY))
return false;
- const base::BinaryValue* binary_value =
- reinterpret_cast<const base::BinaryValue*>(value);
- if (binary_value->GetSize() < sizeof(Header))
+ if (value->GetSize() < sizeof(Header))
return false;
- base::Pickle pickle(binary_value->GetBuffer(), binary_value->GetSize());
+ base::Pickle pickle(value->GetBuffer(), value->GetSize());
// Broken binary value: payload or header size is wrong
if (!pickle.data() || pickle.size() - pickle.payload_size() != sizeof(Header))
return false;
@@ -74,10 +72,8 @@ bool GinJavaBridgeValue::ContainsGinJavaBridgeValue(const base::Value* value) {
std::unique_ptr<const GinJavaBridgeValue> GinJavaBridgeValue::FromValue(
const base::Value* value) {
return std::unique_ptr<const GinJavaBridgeValue>(
- value->IsType(base::Value::Type::BINARY)
- ? new GinJavaBridgeValue(
- reinterpret_cast<const base::BinaryValue*>(value))
- : NULL);
+ value->IsType(base::Value::Type::BINARY) ? new GinJavaBridgeValue(value)
+ : NULL);
}
GinJavaBridgeValue::Type GinJavaBridgeValue::GetType() const {
« no previous file with comments | « content/child/v8_value_converter_impl.cc ('k') | extensions/browser/api/cast_channel/cast_channel_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698