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

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

Issue 2332263002: Updated suborigin serialization to latest spec proposal (Closed)
Patch Set: Convert suborigin schemes to pseudo schemes Created 4 years, 2 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 #include <string> 10 #include <string>
(...skipping 17 matching lines...) Expand all
28 std::vector<std::string> additional_savable_schemes; 28 std::vector<std::string> additional_savable_schemes;
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 37
38 url::AddStandardScheme(kHttpSuboriginScheme, url::SCHEME_WITH_PORT);
nasko 2016/09/22 23:53:42 What breaks if we don't add it as a standard schem
jww 2016/09/23 04:12:44 This is more important for KURL parsing. I'll have
jww 2016/09/23 16:33:48 Just digging a little further through my memory he
nasko 2016/09/23 21:59:48 Hmm, why would KURL depend on content/? This is ve
39 url::AddReferrerScheme(kHttpSuboriginScheme, url::SCHEME_WITH_PORT);
40 url::AddStandardScheme(kHttpsSuboriginScheme, url::SCHEME_WITH_PORT);
41 url::AddReferrerScheme(kHttpsSuboriginScheme, url::SCHEME_WITH_PORT);
42
38 for (const url::SchemeWithType& scheme : additional_standard_schemes) 43 for (const url::SchemeWithType& scheme : additional_standard_schemes)
39 url::AddStandardScheme(scheme.scheme, scheme.type); 44 url::AddStandardScheme(scheme.scheme, scheme.type);
40 45
41 for (const url::SchemeWithType& scheme : additional_referrer_schemes) 46 for (const url::SchemeWithType& scheme : additional_referrer_schemes)
42 url::AddReferrerScheme(scheme.scheme, scheme.type); 47 url::AddReferrerScheme(scheme.scheme, scheme.type);
43 48
44 // Prevent future modification of the scheme lists. This is to prevent 49 // Prevent future modification of the scheme lists. This is to prevent
45 // accidental creation of data races in the program. Add*Scheme aren't 50 // accidental creation of data races in the program. Add*Scheme aren't
46 // threadsafe so must be called when GURL isn't used on any other thread. This 51 // threadsafe so must be called when GURL isn't used on any other thread. This
47 // is really easy to mess up, so we say that all calls to Add*Scheme in Chrome 52 // is really easy to mess up, so we say that all calls to Add*Scheme in Chrome
(...skipping 20 matching lines...) Expand all
68 savable_schemes[default_schemes_count + i] = 73 savable_schemes[default_schemes_count + i] =
69 base::strdup(additional_savable_schemes[i].c_str()); 74 base::strdup(additional_savable_schemes[i].c_str());
70 } 75 }
71 savable_schemes[default_schemes_count + schemes] = 0; 76 savable_schemes[default_schemes_count + schemes] = 0;
72 77
73 SetSavableSchemes(savable_schemes); 78 SetSavableSchemes(savable_schemes);
74 } 79 }
75 } 80 }
76 81
77 } // namespace content 82 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698