From 235dbd26a4aaab464cd67404e158340ca906d843 Mon Sep 17 00:00:00 2001 From: "dbeam@chromium.org" Date: Tue, 28 Jan 2014 06:08:33 +0000 Subject: Add autofill:: namespace to ::i18n::addressinput::{Downloader,Storage} so they're not in the global namespace. BUG=317839 R=estade@chromium.org TEST=compile Review URL: https://codereview.chromium.org/148273006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247410 0039d316-1c4b-4281-b951-d872f2087c98 --- third_party/libaddressinput/chromium/chrome_downloader_impl.cc | 6 +++++- third_party/libaddressinput/chromium/chrome_downloader_impl.h | 8 ++++++-- .../libaddressinput/chromium/chrome_downloader_impl_unittest.cc | 4 ++++ third_party/libaddressinput/chromium/chrome_storage_impl.cc | 4 ++++ third_party/libaddressinput/chromium/chrome_storage_impl.h | 8 ++++++-- .../libaddressinput/chromium/chrome_storage_impl_unittest.cc | 4 ++++ 6 files changed, 29 insertions(+), 5 deletions(-) (limited to 'third_party') diff --git a/third_party/libaddressinput/chromium/chrome_downloader_impl.cc b/third_party/libaddressinput/chromium/chrome_downloader_impl.cc index 4e6c587..baf9d96 100644 --- a/third_party/libaddressinput/chromium/chrome_downloader_impl.cc +++ b/third_party/libaddressinput/chromium/chrome_downloader_impl.cc @@ -11,6 +11,8 @@ #include "net/url_request/url_fetcher.h" #include "url/gurl.h" +namespace autofill { + ChromeDownloaderImpl::ChromeDownloaderImpl(net::URLRequestContextGetter* getter) : getter_(getter) {} @@ -39,7 +41,7 @@ void ChromeDownloaderImpl::OnURLFetchComplete(const net::URLFetcher* source) { bool ok = source->GetResponseCode() == net::HTTP_OK; scoped_ptr data(new std::string()); if (ok) - source->GetResponseAsString(&*data); + source->GetResponseAsString(data.get()); (*request->second->callback)(ok, request->second->url, data.Pass()); delete request->first; @@ -51,3 +53,5 @@ ChromeDownloaderImpl::Request::Request(const std::string& url, scoped_ptr callback) : url(url), callback(callback.Pass()) {} + +} // namespace autofill diff --git a/third_party/libaddressinput/chromium/chrome_downloader_impl.h b/third_party/libaddressinput/chromium/chrome_downloader_impl.h index 99f38c2..09a9e7a 100644 --- a/third_party/libaddressinput/chromium/chrome_downloader_impl.h +++ b/third_party/libaddressinput/chromium/chrome_downloader_impl.h @@ -17,15 +17,17 @@ class URLFetcher; class URLRequestContextGetter; } +namespace autofill { + // A class for downloading rules to let libaddressinput validate international // addresses. -class ChromeDownloaderImpl : public i18n::addressinput::Downloader, +class ChromeDownloaderImpl : public ::i18n::addressinput::Downloader, public net::URLFetcherDelegate { public: explicit ChromeDownloaderImpl(net::URLRequestContextGetter* getter); virtual ~ChromeDownloaderImpl(); - // i18n::addressinput::Downloader: + // ::i18n::addressinput::Downloader: virtual void Download(const std::string& url, scoped_ptr downloaded) OVERRIDE; @@ -49,4 +51,6 @@ class ChromeDownloaderImpl : public i18n::addressinput::Downloader, DISALLOW_COPY_AND_ASSIGN(ChromeDownloaderImpl); }; +} // namespace autofill + #endif // THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_CHROME_DOWNLOADER_IMPL_H_ diff --git a/third_party/libaddressinput/chromium/chrome_downloader_impl_unittest.cc b/third_party/libaddressinput/chromium/chrome_downloader_impl_unittest.cc index 3d1cea1..07683ec 100644 --- a/third_party/libaddressinput/chromium/chrome_downloader_impl_unittest.cc +++ b/third_party/libaddressinput/chromium/chrome_downloader_impl_unittest.cc @@ -9,6 +9,8 @@ #include "net/url_request/url_request_test_util.h" #include "testing/gtest/include/gtest/gtest.h" +namespace autofill { + static const char kFakeUrl[] = "http://example.com"; class ChromeDownloaderImplTest : public testing::Test { @@ -75,3 +77,5 @@ TEST_F(ChromeDownloaderImplTest, Failure) { EXPECT_FALSE(success()); EXPECT_EQ(std::string(), data()); } + +} // namespace autofill diff --git a/third_party/libaddressinput/chromium/chrome_storage_impl.cc b/third_party/libaddressinput/chromium/chrome_storage_impl.cc index 2cd8c01..ea1fca4 100644 --- a/third_party/libaddressinput/chromium/chrome_storage_impl.cc +++ b/third_party/libaddressinput/chromium/chrome_storage_impl.cc @@ -7,6 +7,8 @@ #include "base/prefs/writeable_pref_store.h" #include "base/values.h" +namespace autofill { + ChromeStorageImpl::ChromeStorageImpl(WriteablePrefStore* store) : backing_store_(store), scoped_observer_(this) { @@ -61,3 +63,5 @@ ChromeStorageImpl::Request::Request(const std::string& key, scoped_ptr callback) : key(key), callback(callback.Pass()) {} + +} // namespace autofill diff --git a/third_party/libaddressinput/chromium/chrome_storage_impl.h b/third_party/libaddressinput/chromium/chrome_storage_impl.h index 11da948..98c21e1 100644 --- a/third_party/libaddressinput/chromium/chrome_storage_impl.h +++ b/third_party/libaddressinput/chromium/chrome_storage_impl.h @@ -16,16 +16,18 @@ class WriteablePrefStore; +namespace autofill { + // An implementation of the Storage interface which passes through to an // underlying WriteablePrefStore. -class ChromeStorageImpl : public i18n::addressinput::Storage, +class ChromeStorageImpl : public ::i18n::addressinput::Storage, public PrefStore::Observer { public: // |store| must outlive |this|. explicit ChromeStorageImpl(WriteablePrefStore* store); virtual ~ChromeStorageImpl(); - // i18n::addressinput::Storage implementation. + // ::i18n::addressinput::Storage implementation. virtual void Put(const std::string& key, const std::string& data) OVERRIDE; virtual void Get(const std::string& key, scoped_ptr data_ready) const OVERRIDE; @@ -55,4 +57,6 @@ class ChromeStorageImpl : public i18n::addressinput::Storage, DISALLOW_COPY_AND_ASSIGN(ChromeStorageImpl); }; +} // namespace autofill + #endif // THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_CHROME_STORAGE_IMPL_H_ diff --git a/third_party/libaddressinput/chromium/chrome_storage_impl_unittest.cc b/third_party/libaddressinput/chromium/chrome_storage_impl_unittest.cc index 0e8043d..4bbdbd0 100644 --- a/third_party/libaddressinput/chromium/chrome_storage_impl_unittest.cc +++ b/third_party/libaddressinput/chromium/chrome_storage_impl_unittest.cc @@ -11,6 +11,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/callback.h" +namespace autofill { + // Tests for ChromeStorageImpl object. class ChromeStorageImplTest : public testing::Test { protected: @@ -29,3 +31,5 @@ class ChromeStorageImplTest : public testing::Test { TEST_F(ChromeStorageImplTest, StandardStorageTests) { EXPECT_NO_FATAL_FAILURE(runner_.RunAllTests()); } + +} // namespace autofill -- cgit v1.1