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

Side by Side Diff: third_party/WebKit/WebCore/platform/KURLGooglePrivate.h

Issue 21343: Make it possible to initialize KURLGoogle from a CString. This is so that I... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 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 | Annotate | Revision Log
« no previous file with comments | « third_party/WebKit/WebCore/platform/KURLGoogle.cpp ('k') | webkit/glue/glue_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. 2 * Copyright (c) 2008, 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 String componentString(const url_parse::Component&) const; 71 String componentString(const url_parse::Component&) const;
72 72
73 // Replaces the given components, modifying the current URL. The current 73 // Replaces the given components, modifying the current URL. The current
74 // URL must be valid. 74 // URL must be valid.
75 typedef url_canon::Replacements<url_parse::UTF16Char> Replacements; 75 typedef url_canon::Replacements<url_parse::UTF16Char> Replacements;
76 void replaceComponents(const Replacements&); 76 void replaceComponents(const Replacements&);
77 77
78 // Setters for the data. Using the ASCII version when you know the 78 // Setters for the data. Using the ASCII version when you know the
79 // data is ASCII will be slightly more efficient. The UTF-8 version 79 // data is ASCII will be slightly more efficient. The UTF-8 version
80 // will always be correct if the caller is unsure. 80 // will always be correct if the caller is unsure.
81 void setUtf8(const char* data, int dataLength); 81 void setUtf8(const CString&);
82 void setAscii(const char* data, int dataLength); 82 void setAscii(const CString&);
83 83
84 // TODO(brettw) we can support an additional optimization. Make this 84 // TODO(brettw) we can support an additional optimization. Make this
85 // buffer support both optinal Strings and UTF-8 data. This way, we can use 85 // buffer support both optinal Strings and UTF-8 data. This way, we can use
86 // the optimization from the original KURL which uses = with the origina l 86 // the optimization from the original KURL which uses = with the origina l
87 // string when canonicalization did not change it. This allows the strin gs 87 // string when canonicalization did not change it. This allows the strin gs
88 // to share a buffer internally, and saves a malloc. 88 // to share a buffer internally, and saves a malloc.
89 89
90 // Getters for the data. 90 // Getters for the data.
91 const CString& utf8String() const { return m_utf8; } 91 const CString& utf8String() const { return m_utf8; }
92 const String& string() const; 92 const String& string() const;
(...skipping 13 matching lines...) Expand all
106 // hint (see setUtf8). 106 // hint (see setUtf8).
107 bool m_utf8IsASCII; 107 bool m_utf8IsASCII;
108 108
109 mutable bool m_stringIsValid; 109 mutable bool m_stringIsValid;
110 mutable String m_string; 110 mutable String m_string;
111 }; 111 };
112 112
113 } // namespace WebCore 113 } // namespace WebCore
114 114
115 #endif 115 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/WebCore/platform/KURLGoogle.cpp ('k') | webkit/glue/glue_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698