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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorHighlight.cpp

Issue 1739613002: DevTools: validate protocol input parameters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaselined a test. Created 4 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
Index: third_party/WebKit/Source/core/inspector/InspectorHighlight.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorHighlight.cpp b/third_party/WebKit/Source/core/inspector/InspectorHighlight.cpp
index 944b595807389e5084808b4ae82003b9b755843d..9d66f7042deba8f5eb86d6b7e3802496c0629e85 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorHighlight.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorHighlight.cpp
@@ -358,11 +358,12 @@ bool InspectorHighlight::getBoxModel(Node* node, OwnPtr<protocol::DOM::BoxModel>
Shape::DisplayPaths paths;
FloatQuad boundsQuad;
+ protocol::ErrorSupport errors;
if (const ShapeOutsideInfo* shapeOutsideInfo = shapeOutsideInfoForNode(node, &paths, &boundsQuad)) {
(*model)->setShapeOutside(protocol::DOM::ShapeOutsideInfo::create()
.setBounds(buildArrayForQuad(boundsQuad))
- .setShape(protocol::Array<RefPtr<JSONValue>>::runtimeCast(ShapePathBuilder::buildPath(*view, *layoutObject, *shapeOutsideInfo, paths.shape)))
- .setMarginShape(protocol::Array<RefPtr<JSONValue>>::runtimeCast(ShapePathBuilder::buildPath(*view, *layoutObject, *shapeOutsideInfo, paths.marginShape)))
+ .setShape(protocol::Array<RefPtr<JSONValue>>::parse(ShapePathBuilder::buildPath(*view, *layoutObject, *shapeOutsideInfo, paths.shape), &errors))
+ .setMarginShape(protocol::Array<RefPtr<JSONValue>>::parse(ShapePathBuilder::buildPath(*view, *layoutObject, *shapeOutsideInfo, paths.marginShape), &errors))
.build());
}

Powered by Google App Engine
This is Rietveld 408576698