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

Unified Diff: content/browser/resource_request_body_browser_utils.h

Issue 2908433003: RenderFrameProxyHost::OnOpenURL needs to validate resource request body. (Closed)
Patch Set: Covering RenderFrameHostImpl as well and rearranging the test to pass on Android. Created 3 years, 7 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: content/browser/resource_request_body_browser_utils.h
diff --git a/content/browser/resource_request_body_browser_utils.h b/content/browser/resource_request_body_browser_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..7b4a0e3bda5184059781e81e9bf49605a877fa72
--- /dev/null
+++ b/content/browser/resource_request_body_browser_utils.h
@@ -0,0 +1,24 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_RESOURCE_REQUEST_BODY_BROWSER_UTILS_H_
+#define CONTENT_BROWSER_RESOURCE_REQUEST_BODY_BROWSER_UTILS_H_
+
+#include "base/memory/ref_counted.h"
+
+namespace content {
+
+class SiteInstance;
+class ResourceRequestBodyImpl;
+
+// Checks if |site_instance| can read all elements of |body|.
alexmos 2017/05/25 23:44:06 nit: Maybe elaborate a little bit? I.e., validate
Łukasz Anforowicz 2017/05/26 00:05:14 Done.
+// TODO(lukasza): Remove code duplication - the function below should be reused
+// by RenderFrameHostImpl::OnBeginNavigation and
+// ResourceDispatcherHostImpl::ShouldServiceRequest.
+bool CanReadRequestBody(SiteInstance* site_instance,
+ const scoped_refptr<ResourceRequestBodyImpl>& body);
Łukasz Anforowicz 2017/05/25 19:56:01 Does this look okay? I had some comments about th
alexmos 2017/05/25 23:44:06 Hmm, this might be ok. A static-only class might
Łukasz Anforowicz 2017/05/26 00:05:14 Ok - see https://codereview.chromium.org/290843300
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RESOURCE_REQUEST_BODY_BROWSER_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698