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

Unified Diff: components/payments/content/origin_security_checker.h

Issue 2815763002: Prevent usage of web payments API over insecure HTTPS. (Closed)
Patch Set: Ganggui's comment. 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: components/payments/content/origin_security_checker.h
diff --git a/components/payments/content/origin_security_checker.h b/components/payments/content/origin_security_checker.h
new file mode 100644
index 0000000000000000000000000000000000000000..b7a640f87a6a502d86286121409a468358afdddb
--- /dev/null
+++ b/components/payments/content/origin_security_checker.h
@@ -0,0 +1,29 @@
+// 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 COMPONENTS_PAYMENTS_CONTENT_ORIGIN_SECURITY_CHECKER_H_
+#define COMPONENTS_PAYMENTS_CONTENT_ORIGIN_SECURITY_CHECKER_H_
+
+#include "base/macros.h"
+
+class GURL;
+
+namespace payments {
+
+class OriginSecurityChecker {
+ public:
+ // Returns true for a valid |url| from a secure origin.
+ static bool IsOriginSecure(const GURL& url);
+
+ // Returns true for a valid |url| with a cryptographic scheme, e.g., HTTPS,
+ // HTTPS-SO, WSS.
+ static bool IsSchemeCryptographic(const GURL& url);
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(OriginSecurityChecker);
+};
+
+} // namespace payments
+
+#endif // COMPONENTS_PAYMENTS_CONTENT_ORIGIN_SECURITY_CHECKER_H_

Powered by Google App Engine
This is Rietveld 408576698