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

Side by Side Diff: third_party/WebKit/Source/core/dom/DOMURLUtilsReadOnly.cpp

Issue 2668903003: Replace WTF::emptyString{16Bit}() with a static global (Closed)
Patch Set: Replace WTF::emptyString{16Bit}() with a static global Created 3 years, 10 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
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Motorola Mobility Inc. 3 * Copyright (C) 2012 Motorola Mobility Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 return kurl.host(); 49 return kurl.host();
50 if (isDefaultPortForProtocol(kurl.port(), kurl.protocol())) 50 if (isDefaultPortForProtocol(kurl.port(), kurl.protocol()))
51 return kurl.host(); 51 return kurl.host();
52 return kurl.host() + ":" + String::number(kurl.port()); 52 return kurl.host() + ":" + String::number(kurl.port());
53 } 53 }
54 54
55 String DOMURLUtilsReadOnly::port(const KURL& kurl) { 55 String DOMURLUtilsReadOnly::port(const KURL& kurl) {
56 if (kurl.hasPort()) 56 if (kurl.hasPort())
57 return String::number(kurl.port()); 57 return String::number(kurl.port());
58 58
59 return emptyString(); 59 return emptyString;
60 } 60 }
61 61
62 String DOMURLUtilsReadOnly::search(const KURL& kurl) { 62 String DOMURLUtilsReadOnly::search(const KURL& kurl) {
63 String query = kurl.query(); 63 String query = kurl.query();
64 return query.isEmpty() ? emptyString() : "?" + query; 64 return query.isEmpty() ? emptyString : "?" + query;
65 } 65 }
66 66
67 String DOMURLUtilsReadOnly::hash(const KURL& kurl) { 67 String DOMURLUtilsReadOnly::hash(const KURL& kurl) {
68 String fragmentIdentifier = kurl.fragmentIdentifier(); 68 String fragmentIdentifier = kurl.fragmentIdentifier();
69 if (fragmentIdentifier.isEmpty()) 69 if (fragmentIdentifier.isEmpty())
70 return emptyString(); 70 return emptyString;
71 return AtomicString(String("#" + fragmentIdentifier)); 71 return AtomicString(String("#" + fragmentIdentifier));
72 } 72 }
73 73
74 } // namespace blink 74 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/CharacterData.cpp ('k') | third_party/WebKit/Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698