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

Unified Diff: content/browser/frame_host/data_url_navigation_throttle.h

Issue 2702503002: Block renderer-initiated main frame navigations to data URLs (Closed)
Patch Set: Fix Android PDF tests where PDFs should be downloaded 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
Index: content/browser/frame_host/data_url_navigation_throttle.h
diff --git a/content/browser/frame_host/data_url_navigation_throttle.h b/content/browser/frame_host/data_url_navigation_throttle.h
new file mode 100644
index 0000000000000000000000000000000000000000..2234ee619c29193319c07d2a241599d05e95c723
--- /dev/null
+++ b/content/browser/frame_host/data_url_navigation_throttle.h
@@ -0,0 +1,32 @@
+// 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_FRAME_HOST_DATA_URL_NAVIGATION_THROTTLE_
+#define CONTENT_BROWSER_FRAME_HOST_DATA_URL_NAVIGATION_THROTTLE_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "content/public/browser/navigation_throttle.h"
+
+namespace content {
+
+class DataUrlNavigationThrottle : public NavigationThrottle {
+ public:
+ explicit DataUrlNavigationThrottle(NavigationHandle* navigation_handle);
+ ~DataUrlNavigationThrottle() override;
+
+ // NavigationThrottle method:
+ ThrottleCheckResult WillProcessResponse() override;
+
+ static std::unique_ptr<NavigationThrottle> CreateThrottleForNavigation(
+ NavigationHandle* navigation_handle);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DataUrlNavigationThrottle);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_FRAME_HOST_DATA_URL_NAVIGATION_THROTTLE_

Powered by Google App Engine
This is Rietveld 408576698