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

Side by Side Diff: ios/web/public/url_schemes.mm

Issue 2379363002: [ARC] Converts part of ios/web/public to ARC. (Closed)
Patch Set: 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
« no previous file with comments | « ios/web/BUILD.gn ('k') | ios/web/public/web_client.mm » ('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 "ios/web/public/url_schemes.h" 5 #include "ios/web/public/url_schemes.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ios/web/public/web_client.h" 10 #include "ios/web/public/web_client.h"
11 #include "url/url_util.h" 11 #include "url/url_util.h"
12 12
13 #if !defined(__has_feature) || !__has_feature(objc_arc)
14 #error "This file requires ARC support."
15 #endif
16
13 namespace web { 17 namespace web {
14 18
15 namespace { 19 namespace {
16 void AddStandardSchemeHelper(const url::SchemeWithType& scheme) { 20 void AddStandardSchemeHelper(const url::SchemeWithType& scheme) {
17 url::AddStandardScheme(scheme.scheme, scheme.type); 21 url::AddStandardScheme(scheme.scheme, scheme.type);
18 } 22 }
19 } // namespace 23 } // namespace
20 24
21 void RegisterWebSchemes(bool lock_schemes) { 25 void RegisterWebSchemes(bool lock_schemes) {
22 std::vector<url::SchemeWithType> additional_standard_schemes; 26 std::vector<url::SchemeWithType> additional_standard_schemes;
23 GetWebClient()->AddAdditionalSchemes(&additional_standard_schemes); 27 GetWebClient()->AddAdditionalSchemes(&additional_standard_schemes);
24 std::for_each(additional_standard_schemes.begin(), 28 std::for_each(additional_standard_schemes.begin(),
25 additional_standard_schemes.end(), AddStandardSchemeHelper); 29 additional_standard_schemes.end(), AddStandardSchemeHelper);
26 30
27 // Prevent future modification of the schemes lists. This is to prevent 31 // Prevent future modification of the schemes lists. This is to prevent
28 // accidental creation of data races in the program. Add*Scheme aren't 32 // accidental creation of data races in the program. Add*Scheme aren't
29 // threadsafe so must be called when GURL isn't used on any other thread. This 33 // threadsafe so must be called when GURL isn't used on any other thread. This
30 // is really easy to mess up, so we say that all calls to Add*Scheme in Chrome 34 // is really easy to mess up, so we say that all calls to Add*Scheme in Chrome
31 // must be inside this function. 35 // must be inside this function.
32 if (lock_schemes) 36 if (lock_schemes)
33 url::LockSchemeRegistries(); 37 url::LockSchemeRegistries();
34 } 38 }
35 39
36 } // namespace web 40 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/BUILD.gn ('k') | ios/web/public/web_client.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698