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

Side by Side Diff: Source/weborigin/DatabaseIdentifier.cpp

Issue 23464095: WTF::notFound looks too much like a local variable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/painting/ContinuousPainter.cpp ('k') | Source/weborigin/SecurityPolicy.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 static const char separatorCharacter = '_'; 46 static const char separatorCharacter = '_';
47 47
48 PassRefPtr<SecurityOrigin> createSecurityOriginFromDatabaseIdentifier(const Stri ng& databaseIdentifier) 48 PassRefPtr<SecurityOrigin> createSecurityOriginFromDatabaseIdentifier(const Stri ng& databaseIdentifier)
49 { 49 {
50 if (!databaseIdentifier.containsOnlyASCII()) 50 if (!databaseIdentifier.containsOnlyASCII())
51 return SecurityOrigin::createUnique(); 51 return SecurityOrigin::createUnique();
52 52
53 // Make sure there's a first separator 53 // Make sure there's a first separator
54 size_t separator1 = databaseIdentifier.find(separatorCharacter); 54 size_t separator1 = databaseIdentifier.find(separatorCharacter);
55 if (separator1 == notFound) 55 if (separator1 == kNotFound)
56 return SecurityOrigin::createUnique(); 56 return SecurityOrigin::createUnique();
57 57
58 // Make sure there's a second separator 58 // Make sure there's a second separator
59 size_t separator2 = databaseIdentifier.reverseFind(separatorCharacter); 59 size_t separator2 = databaseIdentifier.reverseFind(separatorCharacter);
60 if (separator2 == notFound) 60 if (separator2 == kNotFound)
61 return SecurityOrigin::createUnique(); 61 return SecurityOrigin::createUnique();
62 62
63 // Ensure there were at least 2 separator characters. Some hostnames on intr anets have 63 // Ensure there were at least 2 separator characters. Some hostnames on intr anets have
64 // underscores in them, so we'll assume that any additional underscores are part of the host. 64 // underscores in them, so we'll assume that any additional underscores are part of the host.
65 if (separator1 == separator2) 65 if (separator1 == separator2)
66 return SecurityOrigin::createUnique(); 66 return SecurityOrigin::createUnique();
67 67
68 // Make sure the port section is a valid port number or doesn't exist 68 // Make sure the port section is a valid port number or doesn't exist
69 bool portOkay; 69 bool portOkay;
70 int port = databaseIdentifier.right(databaseIdentifier.length() - separator2 - 1).toInt(&portOkay); 70 int port = databaseIdentifier.right(databaseIdentifier.length() - separator2 - 1).toInt(&portOkay);
(...skipping 25 matching lines...) Expand all
96 // to avoid breaking existing persistent state. 96 // to avoid breaking existing persistent state.
97 if (securityOrigin->needsDatabaseIdentifierQuirkForFiles()) 97 if (securityOrigin->needsDatabaseIdentifierQuirkForFiles())
98 return "file__0"; 98 return "file__0";
99 99
100 String separatorString(&separatorCharacter, 1); 100 String separatorString(&separatorCharacter, 1);
101 101
102 return securityOrigin->protocol() + separatorString + securityOrigin->host() + separatorString + String::number(securityOrigin->port()); 102 return securityOrigin->protocol() + separatorString + securityOrigin->host() + separatorString + String::number(securityOrigin->port());
103 } 103 }
104 104
105 } // namespace WebCore 105 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/web/painting/ContinuousPainter.cpp ('k') | Source/weborigin/SecurityPolicy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698