OLD | NEW |
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 #include <string> | 10 #include <string> |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 GetContentClient()->AddAdditionalSchemes(&additional_standard_schemes, | 30 GetContentClient()->AddAdditionalSchemes(&additional_standard_schemes, |
31 &additional_referrer_schemes, | 31 &additional_referrer_schemes, |
32 &additional_savable_schemes); | 32 &additional_savable_schemes); |
33 | 33 |
34 url::AddStandardScheme(kChromeDevToolsScheme, url::SCHEME_WITHOUT_PORT); | 34 url::AddStandardScheme(kChromeDevToolsScheme, url::SCHEME_WITHOUT_PORT); |
35 url::AddStandardScheme(kChromeUIScheme, url::SCHEME_WITHOUT_PORT); | 35 url::AddStandardScheme(kChromeUIScheme, url::SCHEME_WITHOUT_PORT); |
36 url::AddStandardScheme(kGuestScheme, url::SCHEME_WITHOUT_PORT); | 36 url::AddStandardScheme(kGuestScheme, url::SCHEME_WITHOUT_PORT); |
37 url::AddStandardScheme(kMetadataScheme, url::SCHEME_WITHOUT_AUTHORITY); | 37 url::AddStandardScheme(kMetadataScheme, url::SCHEME_WITHOUT_AUTHORITY); |
38 | 38 |
39 // TODO(rockot): Remove these. http://crbug.com/590012. | |
40 url::AddStandardScheme(kExeScheme, url::SCHEME_WITHOUT_AUTHORITY); | |
41 url::AddStandardScheme(kMojoScheme, url::SCHEME_WITHOUT_AUTHORITY); | |
42 | |
43 for (const url::SchemeWithType& scheme : additional_standard_schemes) | 39 for (const url::SchemeWithType& scheme : additional_standard_schemes) |
44 url::AddStandardScheme(scheme.scheme, scheme.type); | 40 url::AddStandardScheme(scheme.scheme, scheme.type); |
45 | 41 |
46 for (const url::SchemeWithType& scheme : additional_referrer_schemes) | 42 for (const url::SchemeWithType& scheme : additional_referrer_schemes) |
47 url::AddReferrerScheme(scheme.scheme, scheme.type); | 43 url::AddReferrerScheme(scheme.scheme, scheme.type); |
48 | 44 |
49 // Prevent future modification of the scheme lists. This is to prevent | 45 // Prevent future modification of the scheme lists. This is to prevent |
50 // accidental creation of data races in the program. Add*Scheme aren't | 46 // accidental creation of data races in the program. Add*Scheme aren't |
51 // threadsafe so must be called when GURL isn't used on any other thread. This | 47 // threadsafe so must be called when GURL isn't used on any other thread. This |
52 // is really easy to mess up, so we say that all calls to Add*Scheme in Chrome | 48 // is really easy to mess up, so we say that all calls to Add*Scheme in Chrome |
(...skipping 20 matching lines...) Expand all Loading... |
73 savable_schemes[default_schemes_count + i] = | 69 savable_schemes[default_schemes_count + i] = |
74 base::strdup(additional_savable_schemes[i].c_str()); | 70 base::strdup(additional_savable_schemes[i].c_str()); |
75 } | 71 } |
76 savable_schemes[default_schemes_count + schemes] = 0; | 72 savable_schemes[default_schemes_count + schemes] = 0; |
77 | 73 |
78 SetSavableSchemes(savable_schemes); | 74 SetSavableSchemes(savable_schemes); |
79 } | 75 } |
80 } | 76 } |
81 | 77 |
82 } // namespace content | 78 } // namespace content |
OLD | NEW |