Index: third_party/WebKit/Source/platform/json/JSONValues.h |
diff --git a/third_party/WebKit/Source/platform/json/JSONValues.h b/third_party/WebKit/Source/platform/json/JSONValues.h |
index 4a37cd7913cff7254aa28ade9b781bf7856ca8c2..cb666a840d46d64fe7250a1f8590aa7cab364c23 100644 |
--- a/third_party/WebKit/Source/platform/json/JSONValues.h |
+++ b/third_party/WebKit/Source/platform/json/JSONValues.h |
@@ -177,6 +177,12 @@ class PLATFORM_EXPORT JSONObject : public JSONValue { |
return static_cast<JSONObject*>(value); |
} |
+ static const JSONObject* cast(const JSONValue* value) { |
+ if (!value || value->getType() != TypeObject) |
+ return nullptr; |
+ return static_cast<const JSONObject*>(value); |
+ } |
+ |
static std::unique_ptr<JSONObject> from(std::unique_ptr<JSONValue> value) { |
auto maybeObject = WTF::wrapUnique(JSONObject::cast(value.get())); |
if (maybeObject) |