Changeset 61495 in webkit
- Timestamp:
- Jun 19, 2010 10:11:35 AM (14 years ago)
- Location:
- trunk/WebKit/chromium
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/chromium/ChangeLog
r61490 r61495 1 2010-06-19 Jay Civelli <jcivelli@chromium.org> 2 3 Reviewed by David Levin. 4 5 Adding a < operator to WebURLs so they can be used in std::maps. 6 https://bugs.webkit.org/show_bug.cgi?id=40632 7 8 * public/WebCString.h: 9 (WebKit::operator<): 10 * public/WebURL.h: 11 (WebKit::operator<): 12 * src/WebCString.cpp: 13 (WebKit::WebCString::compare): 14 1 15 2010-06-19 Kent Tamura <tkent@chromium.org> 2 16 -
trunk/WebKit/chromium/public/WebCString.h
r56825 r61495 69 69 } 70 70 71 // Returns 0 if both strings are equals, a value greater than zero if the 72 // first character that does not match has a greater value in this string 73 // than in |other|, or a value less than zero to indicate the opposite. 74 WEBKIT_API int compare(const WebCString& other) const; 75 71 76 WEBKIT_API void reset(); 72 77 WEBKIT_API void assign(const WebCString&); … … 118 123 }; 119 124 125 inline bool operator<(const WebCString& a, const WebCString& b) 126 { 127 return a.compare(b) < 0; 128 } 129 120 130 } // namespace WebKit 121 131 -
trunk/WebKit/chromium/public/WebURL.h
r50682 r61495 139 139 }; 140 140 141 inline bool operator<(const WebURL& a, const WebURL& b) 142 { 143 return a.spec() < b.spec(); 144 } 145 141 146 } // namespace WebKit 142 147 -
trunk/WebKit/chromium/src/WebCString.cpp
r56825 r61495 41 41 class WebCStringPrivate : public WTF::CStringBuffer { 42 42 }; 43 44 int WebCString::compare(const WebCString& other) const 45 { 46 // A null string is always less than a non null one. 47 if (isNull() != other.isNull()) 48 return isNull() ? -1 : 1; 49 50 if (isNull()) 51 return 0; // Both WebStrings are null. 52 53 return strcmp(m_private->data(), other.m_private->data()); 54 } 43 55 44 56 void WebCString::reset()
Note: See TracChangeset
for help on using the changeset viewer.