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

Side by Side Diff: components/dom_distiller/core/distiller_url_fetcher.h

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_URL_FETCHER_H_ 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_URL_FETCHER_H_
6 #define COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_URL_FETCHER_H_ 6 #define COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_URL_FETCHER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 25 matching lines...) Expand all
36 ~DistillerURLFetcher() override; 36 ~DistillerURLFetcher() override;
37 37
38 // Indicates when a fetch is done. 38 // Indicates when a fetch is done.
39 typedef base::Callback<void(const std::string& data)> URLFetcherCallback; 39 typedef base::Callback<void(const std::string& data)> URLFetcherCallback;
40 40
41 // Fetches a |url|. Notifies when the fetch is done via |callback|. 41 // Fetches a |url|. Notifies when the fetch is done via |callback|.
42 virtual void FetchURL(const std::string& url, 42 virtual void FetchURL(const std::string& url,
43 const URLFetcherCallback& callback); 43 const URLFetcherCallback& callback);
44 44
45 protected: 45 protected:
46 virtual net::URLFetcher* CreateURLFetcher( 46 virtual scoped_ptr<net::URLFetcher> CreateURLFetcher(
47 net::URLRequestContextGetter* context_getter, 47 net::URLRequestContextGetter* context_getter,
48 const std::string& url); 48 const std::string& url);
49 49
50 private: 50 private:
51 // net::URLFetcherDelegate: 51 // net::URLFetcherDelegate:
52 void OnURLFetchComplete(const net::URLFetcher* source) override; 52 void OnURLFetchComplete(const net::URLFetcher* source) override;
53 53
54 scoped_ptr<net::URLFetcher> url_fetcher_; 54 scoped_ptr<net::URLFetcher> url_fetcher_;
55 URLFetcherCallback callback_; 55 URLFetcherCallback callback_;
56 net::URLRequestContextGetter* context_getter_; 56 net::URLRequestContextGetter* context_getter_;
57 DISALLOW_COPY_AND_ASSIGN(DistillerURLFetcher); 57 DISALLOW_COPY_AND_ASSIGN(DistillerURLFetcher);
58 }; 58 };
59 59
60 } // namespace dom_distiller 60 } // namespace dom_distiller
61 61
62 #endif // COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_URL_FETCHER_H_ 62 #endif // COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_URL_FETCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698