| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |