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

Side by Side Diff: remoting/base/chromium_url_request.h

Issue 1679023009: Add remoting::UrlRequest interface with 2 implementations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « remoting/base/BUILD.gn ('k') | remoting/base/chromium_url_request.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 2016 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 REMOTING_BASE_CHROMIUM_URL_REQUEST_H_
6 #define REMOTING_BASE_CHROMIUM_URL_REQUEST_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "base/memory/ref_counted.h"
12 #include "net/url_request/url_fetcher_delegate.h"
13 #include "remoting/base/url_request.h"
14
15 namespace net {
16 class URLRequestContextGetter;
17 } // namespace net
18
19 namespace remoting {
20
21 // UrlRequest implementation based on net::URLFetcher.
22 class ChromiumUrlRequest : public UrlRequest, public net::URLFetcherDelegate {
23 public:
24 ChromiumUrlRequest(scoped_refptr<net::URLRequestContextGetter> url_context,
25 const std::string& url);
26 ~ChromiumUrlRequest() override;
27
28 // UrlRequest interface.
29 void AddHeader(const std::string& value) override;
30 void Start(const OnResultCallback& on_result_callback) override;
31
32 private:
33 // net::URLFetcherDelegate interface.
34 void OnURLFetchComplete(const net::URLFetcher* url_fetcher) override;
35
36 scoped_ptr<net::URLFetcher> url_fetcher_;
37 OnResultCallback on_result_callback_;
38 };
39
40 class ChromiumUrlRequestFactory : public UrlRequestFactory {
41 public:
42 ChromiumUrlRequestFactory(
43 scoped_refptr<net::URLRequestContextGetter> url_context);
44 ~ChromiumUrlRequestFactory() override;
45
46 // UrlRequestFactory interface.
47 scoped_ptr<UrlRequest> CreateUrlRequest(const std::string& url) override;
48
49 private:
50 scoped_refptr<net::URLRequestContextGetter> url_context_;
51 };
52
53 } // namespace remoting
54
55 #endif // REMOTING_BASE_CHROMIUM_URL_REQUEST_H_
OLDNEW
« no previous file with comments | « remoting/base/BUILD.gn ('k') | remoting/base/chromium_url_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698