| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 #if INSIDE_BLINK | 37 #if INSIDE_BLINK |
| 38 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
| 39 #endif | 39 #endif |
| 40 #if !INSIDE_BLINK || defined(UNIT_TEST) | 40 #if !INSIDE_BLINK || defined(UNIT_TEST) |
| 41 #include <string> | 41 #include <string> |
| 42 #endif | 42 #endif |
| 43 | 43 |
| 44 namespace WTF { | 44 namespace WTF { |
| 45 class CString; | 45 class CString; |
| 46 class CStringBuffer; | 46 class CStringImpl; |
| 47 } | 47 } |
| 48 | 48 |
| 49 namespace blink { | 49 namespace blink { |
| 50 | 50 |
| 51 class WebString; | 51 class WebString; |
| 52 | 52 |
| 53 // A single-byte string container with unspecified encoding. It is | 53 // A single-byte string container with unspecified encoding. It is |
| 54 // inexpensive to copy a WebCString object. | 54 // inexpensive to copy a WebCString object. |
| 55 // | 55 // |
| 56 // WARNING: It is not safe to pass a WebCString across threads!!! | 56 // WARNING: It is not safe to pass a WebCString across threads!!! |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 return len ? std::string(data(), len) : std::string(); | 105 return len ? std::string(data(), len) : std::string(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 template <class UTF16String> | 108 template <class UTF16String> |
| 109 static WebCString fromUTF16(const UTF16String& s) { | 109 static WebCString fromUTF16(const UTF16String& s) { |
| 110 return fromUTF16(s.data(), s.length()); | 110 return fromUTF16(s.data(), s.length()); |
| 111 } | 111 } |
| 112 #endif | 112 #endif |
| 113 | 113 |
| 114 private: | 114 private: |
| 115 BLINK_COMMON_EXPORT void assign(WTF::CStringBuffer*); | 115 BLINK_COMMON_EXPORT void assign(WTF::CStringImpl*); |
| 116 WebPrivatePtr<WTF::CStringBuffer> m_private; | 116 WebPrivatePtr<WTF::CStringImpl> m_private; |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 inline bool operator<(const WebCString& a, const WebCString& b) { | 119 inline bool operator<(const WebCString& a, const WebCString& b) { |
| 120 return a.compare(b) < 0; | 120 return a.compare(b) < 0; |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace blink | 123 } // namespace blink |
| 124 | 124 |
| 125 #endif | 125 #endif |
| OLD | NEW |