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

Side by Side Diff: ios/net/url_scheme_util.mm

Issue 994823004: [iOS] Upstream //ios/net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "ios/net/url_scheme_util.h"
6
7 #import <Foundation/Foundation.h>
8
9 #include "base/logging.h"
10 #include "base/strings/sys_string_conversions.h"
11 #include "url/gurl.h"
12
13 namespace net {
14
15 bool UrlSchemeIs(NSURL* url, NSString* scheme) {
16 DCHECK([scheme isEqualToString:[scheme lowercaseString]]);
17 NSString* url_scheme = [url scheme];
18 return (url_scheme != nil) &&
19 [url_scheme caseInsensitiveCompare:scheme] == NSOrderedSame;
20 }
21
22 bool UrlHasDataScheme(NSURL* url) {
23 return UrlSchemeIs(url, base::SysUTF8ToNSString(url::kDataScheme));
24 }
25
26 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698