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

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

Issue 2679383003: Share schemes needed for CSP between the browser and the renderer. (Closed)
Patch Set: Rebase and fix conflict. Created 3 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 unified diff | Download patch
« no previous file with comments | « chrome/common/chrome_content_client.cc ('k') | content/public/common/content_client.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/common/url_schemes.h" 5 #include "content/common/url_schemes.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 for (auto& scheme : schemes.local_schemes) 58 for (auto& scheme : schemes.local_schemes)
59 url::AddLocalScheme(scheme.c_str()); 59 url::AddLocalScheme(scheme.c_str());
60 60
61 for (auto& scheme : schemes.no_access_schemes) 61 for (auto& scheme : schemes.no_access_schemes)
62 url::AddNoAccessScheme(scheme.c_str()); 62 url::AddNoAccessScheme(scheme.c_str());
63 63
64 schemes.cors_enabled_schemes.push_back(kChromeUIScheme); 64 schemes.cors_enabled_schemes.push_back(kChromeUIScheme);
65 for (auto& scheme : schemes.cors_enabled_schemes) 65 for (auto& scheme : schemes.cors_enabled_schemes)
66 url::AddCORSEnabledScheme(scheme.c_str()); 66 url::AddCORSEnabledScheme(scheme.c_str());
67 67
68 for (auto& scheme : schemes.csp_bypassing_schemes)
69 url::AddCSPBypassingScheme(scheme.c_str());
70
68 // Prevent future modification of the scheme lists. This is to prevent 71 // Prevent future modification of the scheme lists. This is to prevent
69 // accidental creation of data races in the program. Add*Scheme aren't 72 // accidental creation of data races in the program. Add*Scheme aren't
70 // threadsafe so must be called when GURL isn't used on any other thread. This 73 // threadsafe so must be called when GURL isn't used on any other thread. This
71 // is really easy to mess up, so we say that all calls to Add*Scheme in Chrome 74 // is really easy to mess up, so we say that all calls to Add*Scheme in Chrome
72 // must be inside this function. 75 // must be inside this function.
73 if (lock_schemes) 76 if (lock_schemes)
74 url::LockSchemeRegistries(); 77 url::LockSchemeRegistries();
75 78
76 // Combine the default savable schemes with the additional ones given. 79 // Combine the default savable schemes with the additional ones given.
77 delete savable_schemes; 80 delete savable_schemes;
(...skipping 19 matching lines...) Expand all
97 100
98 const std::vector<GURL>& GetSecureOrigins() { 101 const std::vector<GURL>& GetSecureOrigins() {
99 return *secure_origins; 102 return *secure_origins;
100 } 103 }
101 104
102 const std::vector<std::string>& GetServiceWorkerSchemes() { 105 const std::vector<std::string>& GetServiceWorkerSchemes() {
103 return *service_worker_schemes; 106 return *service_worker_schemes;
104 } 107 }
105 108
106 } // namespace content 109 } // namespace content
OLDNEW
« no previous file with comments | « chrome/common/chrome_content_client.cc ('k') | content/public/common/content_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698