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

Side by Side Diff: webkit/common/database/database_identifier.cc

Issue 260903011: Renamed namespaces of url lib and removed namespace aliases. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Thu 05/01/2014 11:38:37.95 Created 6 years, 7 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 | « url/url_export.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "webkit/common/database/database_identifier.h" 5 #include "webkit/common/database/database_identifier.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "url/url_canon.h" 9 #include "url/url_canon.h"
10 10
(...skipping 21 matching lines...) Expand all
32 // static 32 // static
33 DatabaseIdentifier DatabaseIdentifier::CreateFromOrigin(const GURL& origin) { 33 DatabaseIdentifier DatabaseIdentifier::CreateFromOrigin(const GURL& origin) {
34 if (!origin.is_valid() || origin.is_empty() || 34 if (!origin.is_valid() || origin.is_empty() ||
35 !origin.IsStandard() || SchemeIsUnique(origin.scheme())) 35 !origin.IsStandard() || SchemeIsUnique(origin.scheme()))
36 return DatabaseIdentifier(); 36 return DatabaseIdentifier();
37 37
38 if (origin.SchemeIsFile()) 38 if (origin.SchemeIsFile())
39 return UniqueFileIdentifier(); 39 return UniqueFileIdentifier();
40 40
41 int port = origin.IntPort(); 41 int port = origin.IntPort();
42 if (port == url_parse::PORT_INVALID) 42 if (port == url::PORT_INVALID)
43 return DatabaseIdentifier(); 43 return DatabaseIdentifier();
44 44
45 // We encode the default port for the specified scheme as 0. GURL 45 // We encode the default port for the specified scheme as 0. GURL
46 // canonicalizes this as an unspecified port. 46 // canonicalizes this as an unspecified port.
47 if (port == url_parse::PORT_UNSPECIFIED) 47 if (port == url::PORT_UNSPECIFIED)
48 port = 0; 48 port = 0;
49 49
50 return DatabaseIdentifier(origin.scheme(), 50 return DatabaseIdentifier(origin.scheme(),
51 origin.host(), 51 origin.host(),
52 port, 52 port,
53 false /* unique */, 53 false /* unique */,
54 false /* file */); 54 false /* file */);
55 } 55 }
56 56
57 // static 57 // static
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 if (is_file_) 129 if (is_file_)
130 return GURL("file:///"); 130 return GURL("file:///");
131 if (is_unique_) 131 if (is_unique_)
132 return GURL(); 132 return GURL();
133 if (port_ == 0) 133 if (port_ == 0)
134 return GURL(scheme_ + "://" + hostname_); 134 return GURL(scheme_ + "://" + hostname_);
135 return GURL(scheme_ + "://" + hostname_ + ":" + base::IntToString(port_)); 135 return GURL(scheme_ + "://" + hostname_ + ":" + base::IntToString(port_));
136 } 136 }
137 137
138 } // namespace webkit_database 138 } // namespace webkit_database
OLDNEW
« no previous file with comments | « url/url_export.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698