diff options
38 files changed, 269 insertions, 254 deletions
diff --git a/url/googleurl.gyp b/url/googleurl.gyp deleted file mode 100644 index 2f6f89a..0000000 --- a/url/googleurl.gyp +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright (c) 2012 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# TODO(mark): Upstream this file to googleurl. -{ - 'variables': { - 'chromium_code': 1, - }, - 'targets': [ - { - 'target_name': 'googleurl', - 'type': '<(component)', - 'dependencies': [ - '../../base/base.gyp:base', - '../../third_party/icu/icu.gyp:icudata', - '../../third_party/icu/icu.gyp:icui18n', - '../../third_party/icu/icu.gyp:icuuc', - ], - 'sources': [ - '../../googleurl/src/gurl.cc', - '../../googleurl/src/gurl.h', - '../../googleurl/src/url_canon.h', - '../../googleurl/src/url_canon_etc.cc', - '../../googleurl/src/url_canon_fileurl.cc', - '../../googleurl/src/url_canon_filesystemurl.cc', - '../../googleurl/src/url_canon_host.cc', - '../../googleurl/src/url_canon_icu.cc', - '../../googleurl/src/url_canon_icu.h', - '../../googleurl/src/url_canon_internal.cc', - '../../googleurl/src/url_canon_internal.h', - '../../googleurl/src/url_canon_internal_file.h', - '../../googleurl/src/url_canon_ip.cc', - '../../googleurl/src/url_canon_ip.h', - '../../googleurl/src/url_canon_mailtourl.cc', - '../../googleurl/src/url_canon_path.cc', - '../../googleurl/src/url_canon_pathurl.cc', - '../../googleurl/src/url_canon_query.cc', - '../../googleurl/src/url_canon_relative.cc', - '../../googleurl/src/url_canon_stdstring.h', - '../../googleurl/src/url_canon_stdurl.cc', - '../../googleurl/src/url_file.h', - '../../googleurl/src/url_parse.cc', - '../../googleurl/src/url_parse.h', - '../../googleurl/src/url_parse_file.cc', - '../../googleurl/src/url_parse_internal.h', - '../../googleurl/src/url_util.cc', - '../../googleurl/src/url_util.h', - ], - 'direct_dependent_settings': { - 'include_dirs': [ - '../..', - ], - }, - 'defines': [ - 'FULL_FILESYSTEM_URL_SUPPORT=1', - ], - 'conditions': [ - ['component=="shared_library"', { - 'defines': [ - 'GURL_DLL', - 'GURL_IMPLEMENTATION=1', - ], - 'direct_dependent_settings': { - 'defines': [ - 'GURL_DLL', - ], - }, - }], - ], - # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. - 'msvs_disabled_warnings': [4267, ], - }, - { - 'target_name': 'googleurl_unittests', - 'type': 'executable', - 'dependencies': [ - 'googleurl', - '../../base/base.gyp:base_i18n', - '../../base/base.gyp:run_all_unittests', - '../../testing/gtest.gyp:gtest', - '../../third_party/icu/icu.gyp:icuuc', - ], - 'sources': [ - '../../googleurl/src/gurl_unittest.cc', - '../../googleurl/src/url_canon_unittest.cc', - '../../googleurl/src/url_parse_unittest.cc', - '../../googleurl/src/url_test_utils.h', - '../../googleurl/src/url_util_unittest.cc', - ], - 'defines': [ - 'FULL_FILESYSTEM_URL_SUPPORT=1', - ], - 'conditions': [ - ['os_posix==1 and OS!="mac" and OS!="ios"', { - 'conditions': [ - ['linux_use_tcmalloc==1', { - 'dependencies': [ - '../../base/allocator/allocator.gyp:allocator', - ], - }], - ], - }], - ], - # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. - 'msvs_disabled_warnings': [4267, ], - }, - ], -} diff --git a/url/gurl.cc b/url/gurl.cc index 05f65da..a938fa9 100644 --- a/url/gurl.cc +++ b/url/gurl.cc @@ -27,6 +27,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#include "url/gurl.h" + #ifdef WIN32 #include <windows.h> #else @@ -36,11 +38,9 @@ #include <algorithm> #include <ostream> -#include "googleurl/src/gurl.h" - #include "base/logging.h" -#include "googleurl/src/url_canon_stdstring.h" -#include "googleurl/src/url_util.h" +#include "url/url_canon_stdstring.h" +#include "url/url_util.h" namespace { @@ -27,17 +27,17 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef GOOGLEURL_SRC_GURL_H__ -#define GOOGLEURL_SRC_GURL_H__ +#ifndef URL_GURL_H_ +#define URL_GURL_H_ #include <iosfwd> #include <string> #include "base/string16.h" -#include "googleurl/src/url_canon.h" -#include "googleurl/src/url_canon_stdstring.h" -#include "googleurl/src/url_common.h" -#include "googleurl/src/url_parse.h" +#include "url/url_canon.h" +#include "url/url_canon_stdstring.h" +#include "url/url_common.h" +#include "url/url_parse.h" class GURL { public: @@ -389,4 +389,4 @@ class GURL { // Stream operator so GURL can be used in assertion statements. GURL_API std::ostream& operator<<(std::ostream& out, const GURL& url); -#endif // GOOGLEURL_SRC_GURL_H__ +#endif // URL_GURL_H_ diff --git a/url/gurl_unittest.cc b/url/gurl_unittest.cc index 81177bd..cb289cb 100644 --- a/url/gurl_unittest.cc +++ b/url/gurl_unittest.cc @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "googleurl/src/gurl.h" -#include "googleurl/src/url_canon.h" -#include "googleurl/src/url_test_utils.h" #include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" +#include "url/url_canon.h" +#include "url/url_test_utils.h" // Some implementations of base/basictypes.h may define ARRAYSIZE. // If it's not defined, we define it to the ARRAYSIZE_UNSAFE macro diff --git a/url/url.gyp b/url/url.gyp new file mode 100644 index 0000000..6247089 --- /dev/null +++ b/url/url.gyp @@ -0,0 +1,109 @@ +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'variables': { + 'chromium_code': 1, + }, + 'targets': [ + { + 'target_name': 'url', + 'type': '<(component)', + 'dependencies': [ + '../base/base.gyp:base', + '../third_party/icu/icu.gyp:icudata', + '../third_party/icu/icu.gyp:icui18n', + '../third_party/icu/icu.gyp:icuuc', + ], + 'sources': [ + 'gurl.cc', + 'gurl.h', + 'url_canon.h', + 'url_canon_etc.cc', + 'url_canon_fileurl.cc', + 'url_canon_filesystemurl.cc', + 'url_canon_host.cc', + 'url_canon_icu.cc', + 'url_canon_icu.h', + 'url_canon_internal.cc', + 'url_canon_internal.h', + 'url_canon_internal_file.h', + 'url_canon_ip.cc', + 'url_canon_ip.h', + 'url_canon_mailtourl.cc', + 'url_canon_path.cc', + 'url_canon_pathurl.cc', + 'url_canon_query.cc', + 'url_canon_relative.cc', + 'url_canon_stdstring.cc', + 'url_canon_stdstring.h', + 'url_canon_stdurl.cc', + 'url_file.h', + 'url_parse.cc', + 'url_parse.h', + 'url_parse_file.cc', + 'url_parse_internal.h', + 'url_util.cc', + 'url_util.h', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '..', + ], + }, + 'defines': [ + 'FULL_FILESYSTEM_URL_SUPPORT=1', + ], + 'conditions': [ + ['component=="shared_library"', { + 'defines': [ + 'GURL_DLL', + 'GURL_IMPLEMENTATION=1', + ], + 'direct_dependent_settings': { + 'defines': [ + 'GURL_DLL', + ], + }, + }], + ], + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + 'msvs_disabled_warnings': [4267, ], + }, + { + 'target_name': 'url_unittests', + 'type': 'executable', + 'dependencies': [ + 'url', + '../base/base.gyp:base_i18n', + '../base/base.gyp:run_all_unittests', + '../testing/gtest.gyp:gtest', + '../third_party/icu/icu.gyp:icuuc', + ], + 'sources': [ + 'gurl_unittest.cc', + 'url_canon_unittest.cc', + 'url_parse_unittest.cc', + 'url_test_utils.h', + 'url_util_unittest.cc', + ], + 'defines': [ + 'FULL_FILESYSTEM_URL_SUPPORT=1', + ], + 'conditions': [ + ['os_posix==1 and OS!="mac" and OS!="ios"', { + 'conditions': [ + ['linux_use_tcmalloc==1', { + 'dependencies': [ + '../base/allocator/allocator.gyp:allocator', + ], + }], + ], + }], + ], + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + 'msvs_disabled_warnings': [4267, ], + }, + ], +} diff --git a/url/url_canon.h b/url/url_canon.h index 00ae715..bbb34af 100644 --- a/url/url_canon.h +++ b/url/url_canon.h @@ -26,15 +26,16 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef GOOGLEURL_SRC_URL_CANON_H__ -#define GOOGLEURL_SRC_URL_CANON_H__ -#include <string.h> +#ifndef URL_URL_CANON_H_ +#define URL_URL_CANON_H_ + #include <stdlib.h> +#include <string.h> #include "base/string16.h" -#include "googleurl/src/url_common.h" -#include "googleurl/src/url_parse.h" +#include "url/url_common.h" +#include "url/url_parse.h" namespace url_canon { @@ -909,4 +910,4 @@ GURL_API bool ResolveRelativeURL(const char* base_url, } // namespace url_canon -#endif // GOOGLEURL_SRC_URL_CANON_H__ +#endif // URL_URL_CANON_H_ diff --git a/url/url_canon_etc.cc b/url/url_canon_etc.cc index 318c906..65c0678 100644 --- a/url/url_canon_etc.cc +++ b/url/url_canon_etc.cc @@ -31,8 +31,8 @@ #include <string.h> -#include "googleurl/src/url_canon.h" -#include "googleurl/src/url_canon_internal.h" +#include "url/url_canon.h" +#include "url/url_canon_internal.h" namespace url_canon { diff --git a/url/url_canon_filesystemurl.cc b/url/url_canon_filesystemurl.cc index 7f79208..f00b653 100644 --- a/url/url_canon_filesystemurl.cc +++ b/url/url_canon_filesystemurl.cc @@ -29,12 +29,12 @@ // Functions for canonicalizing "filesystem:file:" URLs. -#include "googleurl/src/url_canon.h" -#include "googleurl/src/url_canon_internal.h" -#include "googleurl/src/url_file.h" -#include "googleurl/src/url_parse_internal.h" -#include "googleurl/src/url_util.h" -#include "googleurl/src/url_util_internal.h" +#include "url/url_canon.h" +#include "url/url_canon_internal.h" +#include "url/url_file.h" +#include "url/url_parse_internal.h" +#include "url/url_util.h" +#include "url/url_util_internal.h" namespace url_canon { diff --git a/url/url_canon_fileurl.cc b/url/url_canon_fileurl.cc index 97023eb..7d83df8 100644 --- a/url/url_canon_fileurl.cc +++ b/url/url_canon_fileurl.cc @@ -29,10 +29,10 @@ // Functions for canonicalizing "file:" URLs. -#include "googleurl/src/url_canon.h" -#include "googleurl/src/url_canon_internal.h" -#include "googleurl/src/url_file.h" -#include "googleurl/src/url_parse_internal.h" +#include "url/url_canon.h" +#include "url/url_canon_internal.h" +#include "url/url_file.h" +#include "url/url_parse_internal.h" namespace url_canon { diff --git a/url/url_canon_host.cc b/url/url_canon_host.cc index 6642004..f4c837d 100644 --- a/url/url_canon_host.cc +++ b/url/url_canon_host.cc @@ -28,8 +28,8 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "base/logging.h" -#include "googleurl/src/url_canon.h" -#include "googleurl/src/url_canon_internal.h" +#include "url/url_canon.h" +#include "url/url_canon_internal.h" namespace url_canon { diff --git a/url/url_canon_icu.cc b/url/url_canon_icu.cc index eaae643..028b995 100644 --- a/url/url_canon_icu.cc +++ b/url/url_canon_icu.cc @@ -35,10 +35,9 @@ #include <unicode/ucnv_cb.h> #include <unicode/uidna.h> -#include "googleurl/src/url_canon_icu.h" -#include "googleurl/src/url_canon_internal.h" // for _itoa_s - #include "base/logging.h" +#include "url/url_canon_icu.h" +#include "url/url_canon_internal.h" // for _itoa_s namespace url_canon { diff --git a/url/url_canon_icu.h b/url/url_canon_icu.h index e529fcb..9f54f1a 100644 --- a/url/url_canon_icu.h +++ b/url/url_canon_icu.h @@ -29,10 +29,11 @@ // ICU integration functions. -#ifndef GOOGLEURL_SRC_URL_CANON_ICU_H__ -#define GOOGLEURL_SRC_URL_CANON_ICU_H__ +#ifndef URL_URL_CANON_ICU_H_ +#define URL_URL_CANON_ICU_H_ -#include "googleurl/src/url_canon.h" +#include "base/compiler_specific.h" +#include "url/url_canon.h" typedef struct UConverter UConverter; @@ -51,7 +52,7 @@ class ICUCharsetConverter : public CharsetConverter { GURL_API virtual void ConvertFromUTF16(const char16* input, int input_len, - CanonOutput* output); + CanonOutput* output) OVERRIDE; private: // The ICU converter, not owned by this class. @@ -60,4 +61,4 @@ class ICUCharsetConverter : public CharsetConverter { } // namespace url_canon -#endif // GOOGLEURL_SRC_URL_CANON_ICU_H__ +#endif // URL_URL_CANON_ICU_H_ diff --git a/url/url_canon_internal.cc b/url/url_canon_internal.cc index cd791bb..e74929b 100644 --- a/url/url_canon_internal.cc +++ b/url/url_canon_internal.cc @@ -27,12 +27,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include <cstdio> #include <errno.h> #include <stdlib.h> + +#include <cstdio> #include <string> -#include "googleurl/src/url_canon_internal.h" +#include "url/url_canon_internal.h" namespace url_canon { diff --git a/url/url_canon_internal.h b/url/url_canon_internal.h index 9165398..ce0ed4d 100644 --- a/url/url_canon_internal.h +++ b/url/url_canon_internal.h @@ -32,13 +32,13 @@ // templace bloat because everything is inlined when anybody calls any of our // functions. -#ifndef GOOGLEURL_SRC_URL_CANON_INTERNAL_H__ -#define GOOGLEURL_SRC_URL_CANON_INTERNAL_H__ +#ifndef URL_URL_CANON_INTERNAL_H_ +#define URL_URL_CANON_INTERNAL_H_ #include <stdlib.h> #include "base/logging.h" -#include "googleurl/src/url_canon.h" +#include "url/url_canon.h" namespace url_canon { @@ -458,4 +458,4 @@ inline unsigned long long _strtoui64(const char* nptr, } // namespace url_canon -#endif // GOOGLEURL_SRC_URL_CANON_INTERNAL_H__ +#endif // URL_URL_CANON_INTERNAL_H_ diff --git a/url/url_canon_internal_file.h b/url/url_canon_internal_file.h index 63a9c5b..c7a532c 100644 --- a/url/url_canon_internal_file.h +++ b/url/url_canon_internal_file.h @@ -36,11 +36,11 @@ // *** This file must be included after url_canon_internal as we depend on some // functions in it. *** -#ifndef GOOGLEURL_SRC_URL_CANON_INTERNAL_FILE_H__ -#define GOOGLEURL_SRC_URL_CANON_INTERNAL_FILE_H__ +#ifndef URL_URL_CANON_INTERNAL_FILE_H_ +#define URL_URL_CANON_INTERNAL_FILE_H_ -#include "googleurl/src/url_file.h" -#include "googleurl/src/url_parse_internal.h" +#include "url/url_file.h" +#include "url/url_parse_internal.h" using namespace url_canon; @@ -154,4 +154,4 @@ static bool DoCanonicalizeFileURL(const URLComponentSource<CHAR>& source, return success; } -#endif // GOOGLEURL_SRC_URL_CANON_INTERNAL_FILE_H__ +#endif // URL_URL_CANON_INTERNAL_FILE_H_ diff --git a/url/url_canon_ip.cc b/url/url_canon_ip.cc index 1421e79..cd6e17d 100644 --- a/url/url_canon_ip.cc +++ b/url/url_canon_ip.cc @@ -27,13 +27,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "googleurl/src/url_canon_ip.h" +#include "url/url_canon_ip.h" #include <stdlib.h> #include "base/basictypes.h" #include "base/logging.h" -#include "googleurl/src/url_canon_internal.h" +#include "url/url_canon_internal.h" namespace url_canon { diff --git a/url/url_canon_ip.h b/url/url_canon_ip.h index a2900c6..d5dca67 100644 --- a/url/url_canon_ip.h +++ b/url/url_canon_ip.h @@ -27,13 +27,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef GOOGLEURL_SRC_URL_CANON_IP_H__ -#define GOOGLEURL_SRC_URL_CANON_IP_H__ +#ifndef URL_URL_CANON_IP_H_ +#define URL_URL_CANON_IP_H_ #include "base/string16.h" -#include "googleurl/src/url_canon.h" -#include "googleurl/src/url_common.h" -#include "googleurl/src/url_parse.h" +#include "url/url_canon.h" +#include "url/url_common.h" +#include "url/url_parse.h" namespace url_canon { @@ -106,4 +106,4 @@ GURL_API bool IPv6AddressToNumber(const char16* spec, } // namespace url_canon -#endif // GOOGLEURL_SRC_URL_CANON_IP_H__ +#endif // URL_URL_CANON_IP_H_ diff --git a/url/url_canon_mailtourl.cc b/url/url_canon_mailtourl.cc index 97868b8..a23f901 100644 --- a/url/url_canon_mailtourl.cc +++ b/url/url_canon_mailtourl.cc @@ -29,10 +29,10 @@ // Functions for canonicalizing "mailto:" URLs. -#include "googleurl/src/url_canon.h" -#include "googleurl/src/url_canon_internal.h" -#include "googleurl/src/url_file.h" -#include "googleurl/src/url_parse_internal.h" +#include "url/url_canon.h" +#include "url/url_canon_internal.h" +#include "url/url_file.h" +#include "url/url_parse_internal.h" namespace url_canon { diff --git a/url/url_canon_path.cc b/url/url_canon_path.cc index d86643a..8edd5b9 100644 --- a/url/url_canon_path.cc +++ b/url/url_canon_path.cc @@ -29,9 +29,9 @@ // Canonicalization functions for the paths of URLs. #include "base/logging.h" -#include "googleurl/src/url_canon.h" -#include "googleurl/src/url_canon_internal.h" -#include "googleurl/src/url_parse_internal.h" +#include "url/url_canon.h" +#include "url/url_canon_internal.h" +#include "url/url_parse_internal.h" namespace url_canon { diff --git a/url/url_canon_pathurl.cc b/url/url_canon_pathurl.cc index 4a990c7..21469508 100644 --- a/url/url_canon_pathurl.cc +++ b/url/url_canon_pathurl.cc @@ -31,8 +31,8 @@ // of a URL, these are URLs that have no authority section, only a path. For // example, "javascript:" and "data:". -#include "googleurl/src/url_canon.h" -#include "googleurl/src/url_canon_internal.h" +#include "url/url_canon.h" +#include "url/url_canon_internal.h" namespace url_canon { diff --git a/url/url_canon_query.cc b/url/url_canon_query.cc index cee8774..e7fb7e6 100644 --- a/url/url_canon_query.cc +++ b/url/url_canon_query.cc @@ -27,8 +27,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "googleurl/src/url_canon.h" -#include "googleurl/src/url_canon_internal.h" +#include "url/url_canon.h" +#include "url/url_canon_internal.h" // Query canonicalization in IE // ---------------------------- diff --git a/url/url_canon_relative.cc b/url/url_canon_relative.cc index 63630b4..08e7c25 100644 --- a/url/url_canon_relative.cc +++ b/url/url_canon_relative.cc @@ -30,11 +30,11 @@ // Canonicalizer functions for working with and resolving relative URLs. #include "base/logging.h" -#include "googleurl/src/url_canon.h" -#include "googleurl/src/url_canon_internal.h" -#include "googleurl/src/url_file.h" -#include "googleurl/src/url_parse_internal.h" -#include "googleurl/src/url_util_internal.h" +#include "url/url_canon.h" +#include "url/url_canon_internal.h" +#include "url/url_file.h" +#include "url/url_parse_internal.h" +#include "url/url_util_internal.h" namespace url_canon { diff --git a/url/url_canon_stdstring.cc b/url/url_canon_stdstring.cc new file mode 100644 index 0000000..2cf7b9d --- /dev/null +++ b/url/url_canon_stdstring.cc @@ -0,0 +1,15 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "url/url_canon_stdstring.h" + +namespace url_canon { + +void StdStringCanonOutput::Resize(int sz) { + str_->resize(sz); + buffer_ = str_->empty() ? NULL : &(*str_)[0]; + buffer_len_ = sz; +} + +} // namespace url_canon diff --git a/url/url_canon_stdstring.h b/url/url_canon_stdstring.h index 21272e0..cb51f1d 100644 --- a/url/url_canon_stdstring.h +++ b/url/url_canon_stdstring.h @@ -31,11 +31,14 @@ // strings. Because the canonicalizer tries not to be dependent on the STL, // we have segregated it here. -#ifndef GOOGLEURL_SRC_URL_CANON_STDSTRING_H__ -#define GOOGLEURL_SRC_URL_CANON_STDSTRING_H__ +#ifndef URL_URL_CANON_STDSTRING_H_ +#define URL_URL_CANON_STDSTRING_H_ #include <string> -#include "googleurl/src/url_canon.h" + +#include "base/compiler_specific.h" +#include "url/url_canon.h" +#include "url/url_common.h" namespace url_canon { @@ -55,7 +58,7 @@ namespace url_canon { // // Therefore, the user should call Complete() before using the string that // this class wrote into. -class StdStringCanonOutput : public CanonOutput { +class GURL_API StdStringCanonOutput : public CanonOutput { public: StdStringCanonOutput(std::string* str) : CanonOutput(), @@ -75,11 +78,7 @@ class StdStringCanonOutput : public CanonOutput { buffer_len_ = cur_len_; } - virtual void Resize(int sz) { - str_->resize(sz); - buffer_ = str_->empty() ? NULL : &(*str_)[0]; - buffer_len_ = sz; - } + virtual void Resize(int sz) OVERRIDE; protected: std::string* str_; @@ -130,5 +129,4 @@ class StdStringReplacements : } // namespace url_canon -#endif // GOOGLEURL_SRC_URL_CANON_STDSTRING_H__ - +#endif // URL_URL_CANON_STDSTRING_H_ diff --git a/url/url_canon_stdurl.cc b/url/url_canon_stdurl.cc index 1e21a14..f7f1eaf 100644 --- a/url/url_canon_stdurl.cc +++ b/url/url_canon_stdurl.cc @@ -30,8 +30,8 @@ // Functions to canonicalize "standard" URLs, which are ones that have an // authority section including a host name. -#include "googleurl/src/url_canon.h" -#include "googleurl/src/url_canon_internal.h" +#include "url/url_canon.h" +#include "url/url_canon_internal.h" namespace url_canon { diff --git a/url/url_canon_unittest.cc b/url/url_canon_unittest.cc index 0c57f55..55b349f 100644 --- a/url/url_canon_unittest.cc +++ b/url/url_canon_unittest.cc @@ -30,13 +30,13 @@ #include <errno.h> #include <unicode/ucnv.h> -#include "googleurl/src/url_canon.h" -#include "googleurl/src/url_canon_icu.h" -#include "googleurl/src/url_canon_internal.h" -#include "googleurl/src/url_canon_stdstring.h" -#include "googleurl/src/url_parse.h" -#include "googleurl/src/url_test_utils.h" #include "testing/gtest/include/gtest/gtest.h" +#include "url/url_canon.h" +#include "url/url_canon_icu.h" +#include "url/url_canon_internal.h" +#include "url/url_canon_stdstring.h" +#include "url/url_parse.h" +#include "url/url_test_utils.h" // Some implementations of base/basictypes.h may define ARRAYSIZE. // If it's not defined, we define it to the ARRAYSIZE_UNSAFE macro diff --git a/url/url_common.h b/url/url_common.h index ac045a8..5e67a0f 100644 --- a/url/url_common.h +++ b/url/url_common.h @@ -27,8 +27,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef GOOGLEURL_SRC_URL_COMMON_H__ -#define GOOGLEURL_SRC_URL_COMMON_H__ +#ifndef URL_URL_COMMON_H_ +#define URL_URL_COMMON_H_ #if !defined(GURL_IMPLEMENTATION) #define GURL_IMPLEMENTATION 0 @@ -50,5 +50,4 @@ #define GURL_API #endif -#endif // GOOGLEURL_SRC_URL_COMMON_H__ - +#endif // URL_URL_COMMON_H_ diff --git a/url/url_file.h b/url/url_file.h index c1b8ac9..e91a73c 100644 --- a/url/url_file.h +++ b/url/url_file.h @@ -30,10 +30,10 @@ // Provides shared functions used by the internals of the parser and // canonicalizer for file URLs. Do not use outside of these modules. -#ifndef GOOGLEURL_SRC_URL_FILE_H__ -#define GOOGLEURL_SRC_URL_FILE_H__ +#ifndef URL_URL_FILE_H_ +#define URL_URL_FILE_H_ -#include "googleurl/src/url_parse_internal.h" +#include "url/url_parse_internal.h" namespace url_parse { @@ -105,4 +105,4 @@ inline bool DoesBeginUNCPath(const CHAR* text, } // namespace url_parse -#endif // GOOGLEURL_SRC_URL_FILE_H__ +#endif // URL_URL_FILE_H_ diff --git a/url/url_parse.cc b/url/url_parse.cc index b06f4bb..6b6af44 100644 --- a/url/url_parse.cc +++ b/url/url_parse.cc @@ -34,14 +34,14 @@ * * ***** END LICENSE BLOCK ***** */ -#include "googleurl/src/url_parse.h" +#include "url/url_parse.h" #include <stdlib.h> #include "base/logging.h" -#include "googleurl/src/url_parse_internal.h" -#include "googleurl/src/url_util.h" -#include "googleurl/src/url_util_internal.h" +#include "url/url_parse_internal.h" +#include "url/url_util.h" +#include "url/url_util_internal.h" namespace url_parse { diff --git a/url/url_parse.h b/url/url_parse.h index 3dbe98a..ca01224 100644 --- a/url/url_parse.h +++ b/url/url_parse.h @@ -27,14 +27,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef GOOGLEURL_SRC_URL_PARSE_H__ -#define GOOGLEURL_SRC_URL_PARSE_H__ +#ifndef URL_URL_PARSE_H_ +#define URL_URL_PARSE_H_ #include <string> #include "base/basictypes.h" #include "base/string16.h" -#include "googleurl/src/url_common.h" +#include "url/url_common.h" namespace url_parse { @@ -370,4 +370,4 @@ GURL_API bool ExtractQueryKeyValue(const char16* url, } // namespace url_parse -#endif // GOOGLEURL_SRC_URL_PARSE_H__ +#endif // URL_URL_PARSE_H_ diff --git a/url/url_parse_file.cc b/url/url_parse_file.cc index 2e8429f..d944333d 100644 --- a/url/url_parse_file.cc +++ b/url/url_parse_file.cc @@ -28,9 +28,9 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "base/logging.h" -#include "googleurl/src/url_file.h" -#include "googleurl/src/url_parse.h" -#include "googleurl/src/url_parse_internal.h" +#include "url/url_file.h" +#include "url/url_parse.h" +#include "url/url_parse_internal.h" // Interesting IE file:isms... // diff --git a/url/url_parse_internal.h b/url/url_parse_internal.h index 61bd068..c3b233f 100644 --- a/url/url_parse_internal.h +++ b/url/url_parse_internal.h @@ -29,10 +29,10 @@ // Contains common inline helper functions used by the URL parsing routines. -#ifndef GOOGLEURL_SRC_URL_PARSE_INTERNAL_H__ -#define GOOGLEURL_SRC_URL_PARSE_INTERNAL_H__ +#ifndef URL_URL_PARSE_INTERNAL_H_ +#define URL_URL_PARSE_INTERNAL_H_ -#include "googleurl/src/url_parse.h" +#include "url/url_parse.h" namespace url_parse { @@ -109,4 +109,4 @@ void ParseAfterScheme(const char16* spec, } // namespace url_parse -#endif // GOOGLEURL_SRC_URL_PARSE_INTERNAL_H__ +#endif // URL_URL_PARSE_INTERNAL_H_ diff --git a/url/url_parse_unittest.cc b/url/url_parse_unittest.cc index cc3eb1b..7293d23 100644 --- a/url/url_parse_unittest.cc +++ b/url/url_parse_unittest.cc @@ -28,8 +28,8 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "base/basictypes.h" -#include "googleurl/src/url_parse.h" #include "testing/gtest/include/gtest/gtest.h" +#include "url/url_parse.h" // Some implementations of base/basictypes.h may define ARRAYSIZE. // If it's not defined, we define it to the ARRAYSIZE_UNSAFE macro diff --git a/url/url_test_utils.h b/url/url_test_utils.h index 6278e3f..23c7290 100644 --- a/url/url_test_utils.h +++ b/url/url_test_utils.h @@ -30,14 +30,14 @@ // Convenience functions for string conversions. // These are mostly intended for use in unit tests. -#ifndef GOOGLEURL_SRC_URL_TEST_UTILS_H__ -#define GOOGLEURL_SRC_URL_TEST_UTILS_H__ +#ifndef URL_URL_TEST_UTILS_H_ +#define URL_URL_TEST_UTILS_H_ #include <string> #include "base/string16.h" -#include "googleurl/src/url_canon_internal.h" #include "testing/gtest/include/gtest/gtest.h" +#include "url/url_canon_internal.h" namespace url_test_utils { @@ -75,4 +75,4 @@ inline std::string ConvertUTF16ToUTF8(const string16& src) { } // namespace url_test_utils -#endif // GOOGLEURL_SRC_URL_TEST_UTILS_H__ +#endif // URL_URL_TEST_UTILS_H_ diff --git a/url/url_util.cc b/url/url_util.cc index 9d621bc2..74186f5 100644 --- a/url/url_util.cc +++ b/url/url_util.cc @@ -27,15 +27,16 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#include "url/url_util.h" + #include <string.h> -#include <vector> -#include "googleurl/src/url_util.h" +#include <vector> #include "base/logging.h" -#include "googleurl/src/url_canon_internal.h" -#include "googleurl/src/url_file.h" -#include "googleurl/src/url_util_internal.h" +#include "url/url_canon_internal.h" +#include "url/url_file.h" +#include "url/url_util_internal.h" namespace url_util { diff --git a/url/url_util.h b/url/url_util.h index 9e53d2d..9911196 100644 --- a/url/url_util.h +++ b/url/url_util.h @@ -27,15 +27,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef GOOGLEURL_SRC_URL_UTIL_H__ -#define GOOGLEURL_SRC_URL_UTIL_H__ +#ifndef URL_URL_UTIL_H_ +#define URL_URL_UTIL_H_ #include <string> #include "base/string16.h" -#include "googleurl/src/url_common.h" -#include "googleurl/src/url_parse.h" -#include "googleurl/src/url_canon.h" +#include "url/url_canon.h" +#include "url/url_common.h" +#include "url/url_parse.h" namespace url_util { @@ -225,4 +225,4 @@ GURL_API void EncodeURIComponent(const char* input, int length, } // namespace url_util -#endif // GOOGLEURL_SRC_URL_UTIL_H__ +#endif // URL_URL_UTIL_H_ diff --git a/url/url_util_internal.h b/url/url_util_internal.h index 1fbb46a..acc4b2e 100644 --- a/url/url_util_internal.h +++ b/url/url_util_internal.h @@ -27,14 +27,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef GOOGLEURL_SRC_URL_UTIL_INTERNAL_H__ -#define GOOGLEURL_SRC_URL_UTIL_INTERNAL_H__ +#ifndef URL_URL_UTIL_INTERNAL_H_ +#define URL_URL_UTIL_INTERNAL_H_ #include <string> #include "base/string16.h" -#include "googleurl/src/url_common.h" -#include "googleurl/src/url_parse.h" +#include "url/url_common.h" +#include "url/url_parse.h" namespace url_util { @@ -53,4 +53,4 @@ bool CompareSchemeComponent(const char16* spec, } // namespace url_util -#endif // GOOGLEURL_SRC_URL_UTIL_INTERNAL_H__ +#endif // URL_URL_UTIL_INTERNAL_H_ diff --git a/url/url_util_unittest.cc b/url/url_util_unittest.cc index c7b39fe..6d210fc 100644 --- a/url/url_util_unittest.cc +++ b/url/url_util_unittest.cc @@ -27,12 +27,12 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "googleurl/src/url_canon.h" -#include "googleurl/src/url_canon_stdstring.h" -#include "googleurl/src/url_parse.h" -#include "googleurl/src/url_test_utils.h" -#include "googleurl/src/url_util.h" #include "testing/gtest/include/gtest/gtest.h" +#include "url/url_canon.h" +#include "url/url_canon_stdstring.h" +#include "url/url_parse.h" +#include "url/url_test_utils.h" +#include "url/url_util.h" TEST(URLUtilTest, FindAndCompareScheme) { url_parse::Component found_scheme; |