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

Unified Diff: third_party/mozilla/NSString+Utils.mm

Issue 1904001: Fix -[NSString isValidURI]. (Closed)
Patch Set: Address review comments Created 10 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | third_party/mozilla/README.chromium » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/mozilla/NSString+Utils.mm
diff --git a/third_party/mozilla/NSString+Utils.m b/third_party/mozilla/NSString+Utils.mm
similarity index 98%
rename from third_party/mozilla/NSString+Utils.m
rename to third_party/mozilla/NSString+Utils.mm
index c1455055fba76162be9573ffc4ae73351cfbc254..bc6b34246cea144f79e1e442f013507293a6d7c9 100644
--- a/third_party/mozilla/NSString+Utils.m
+++ b/third_party/mozilla/NSString+Utils.mm
@@ -39,6 +39,7 @@
#import <AppKit/AppKit.h> // for NSStringDrawing.h
#import "NSString+Utils.h"
+#include "googleurl/src/gurl.h"
@implementation NSString (ChimeraStringUtils)
@@ -89,12 +90,12 @@
- (BOOL)isValidURI
{
- // This will only return a non-nil object for valid, well-formed URI strings
- NSURL* testURL = [NSURL URLWithString:self];
+ // isValid() will only be true for valid, well-formed URI strings
+ GURL testURL([self UTF8String]);
// |javascript:| and |data:| URIs might not have passed the test,
// but spaces will work OK, so evaluate them separately.
- if ((testURL) || [self isLooselyValidatedURI]) {
+ if ((testURL.is_valid()) || [self isLooselyValidatedURI]) {
return YES;
}
return NO;
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | third_party/mozilla/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698