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

Side by Side Diff: third_party/libaddressinput/chromium/chrome_downloader_impl.h

Issue 127223003: [rAc - libaddressinput] Chrome download impl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 6 years, 11 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 | « no previous file | third_party/libaddressinput/chromium/chrome_downloader_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_CHROME_DOWNLOADER_IMPL_H_
6 #define THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_CHROME_DOWNLOADER_IMPL_H_
7
8 #include <map>
9 #include <string>
10
11 #include "base/memory/scoped_vector.h"
12 #include "net/url_request/url_fetcher_delegate.h"
13 #include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/downl oader.h"
14
15 namespace net {
16 class URLFetcher;
17 class URLRequestContextGetter;
18 }
19
20 // A class for downloading rules to let libaddressinput validate international
21 // addresses.
22 class ChromeDownloaderImpl : public i18n::addressinput::Downloader,
23 public net::URLFetcherDelegate {
24 public:
25 explicit ChromeDownloaderImpl(net::URLRequestContextGetter* getter);
26 virtual ~ChromeDownloaderImpl();
27
28 // i18n::addressinput::Downloader:
29 virtual void Download(const std::string& url,
30 scoped_ptr<Callback> downloaded) OVERRIDE;
31
32 // net::URLFetcherDelegate:
33 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
34
35 private:
36 struct Request {
37 Request(const std::string& url, scoped_ptr<Callback> callback);
38
39 std::string url;
40 scoped_ptr<Callback> callback;
41 };
42
43 net::URLRequestContextGetter* const getter_; // weak
44
45 // Maps from active url fetcher to request metadata. Both the key and value
46 // are owned.
47 std::map<const net::URLFetcher*, Request*> requests_;
48
49 DISALLOW_COPY_AND_ASSIGN(ChromeDownloaderImpl);
50 };
51
52 #endif // THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_CHROME_DOWNLOADER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | third_party/libaddressinput/chromium/chrome_downloader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698