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

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

Issue 2760463005: Fix handling of external protocols with PlzNavigate. (Closed)
Patch Set: review comments Created 3 years, 9 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
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
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) 68 for (auto& scheme : schemes.csp_bypassing_schemes)
69 url::AddCSPBypassingScheme(scheme.c_str()); 69 url::AddCSPBypassingScheme(scheme.c_str());
70 70
71 for (auto& scheme : schemes.empty_document_schemes)
72 url::AddEmptyDocumentScheme(scheme.c_str());
73
71 // Prevent future modification of the scheme lists. This is to prevent 74 // Prevent future modification of the scheme lists. This is to prevent
72 // accidental creation of data races in the program. Add*Scheme aren't 75 // accidental creation of data races in the program. Add*Scheme aren't
73 // threadsafe so must be called when GURL isn't used on any other thread. This 76 // threadsafe so must be called when GURL isn't used on any other thread. This
74 // is really easy to mess up, so we say that all calls to Add*Scheme in Chrome 77 // is really easy to mess up, so we say that all calls to Add*Scheme in Chrome
75 // must be inside this function. 78 // must be inside this function.
76 if (lock_schemes) 79 if (lock_schemes)
77 url::LockSchemeRegistries(); 80 url::LockSchemeRegistries();
78 81
79 // Combine the default savable schemes with the additional ones given. 82 // Combine the default savable schemes with the additional ones given.
80 delete savable_schemes; 83 delete savable_schemes;
(...skipping 19 matching lines...) Expand all
100 103
101 const std::vector<GURL>& GetSecureOrigins() { 104 const std::vector<GURL>& GetSecureOrigins() {
102 return *secure_origins; 105 return *secure_origins;
103 } 106 }
104 107
105 const std::vector<std::string>& GetServiceWorkerSchemes() { 108 const std::vector<std::string>& GetServiceWorkerSchemes() {
106 return *service_worker_schemes; 109 return *service_worker_schemes;
107 } 110 }
108 111
109 } // namespace content 112 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698