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

Side by Side Diff: content/common/origin_util.cc

Issue 1072933006: Support whitelisting to handle insecure origins as trustworthy origins (chromium) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added more tests Created 5 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 unified diff | Download patch
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | content/public/common/origin_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/common/origin_util.h" 5 #include "content/public/common/origin_util.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "content/public/common/content_client.h" 9 #include "content/public/common/content_client.h"
10 #include "net/base/net_util.h" 10 #include "net/base/net_util.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 if (ContainsKey(g_trustworthy_whitelist.Get().schemes(), url.scheme())) 53 if (ContainsKey(g_trustworthy_whitelist.Get().schemes(), url.scheme()))
54 return true; 54 return true;
55 55
56 if (ContainsKey(g_trustworthy_whitelist.Get().origins(), url.GetOrigin())) 56 if (ContainsKey(g_trustworthy_whitelist.Get().origins(), url.GetOrigin()))
57 return true; 57 return true;
58 58
59 return false; 59 return false;
60 } 60 }
61 61
62 void ResetSecureSchemesAndOriginsForTesting() {
63 g_trustworthy_whitelist.Get().Reset();
64 }
65
62 } // namespace content 66 } // namespace content
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | content/public/common/origin_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698