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

Side by Side Diff: content/browser/appcache/appcache_url_request.cc

Issue 2848493007: Reduce/Remove URLRequest dependencies from AppCacheRequestHandler (Closed)
Patch Set: Created 3 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
(Empty)
1 // Copyright (c) 2017 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 #include "content/browser/appcache/appcache_url_request.h"
6 #include "net/url_request/url_request.h"
7
8 namespace content {
9
10 // static
11 AppCacheURLRequest* AppCacheURLRequest::Create(net::URLRequest* url_request) {
12 return new AppCacheURLRequest(url_request);
13 }
14
15 const GURL& AppCacheURLRequest::GetURL() const {
16 return url_request_->url();
17 }
18
19 const std::string& AppCacheURLRequest::GetMethod() const {
20 return url_request_->method();
21 }
22
23 const GURL& AppCacheURLRequest::GetFirstPartyForCookies() const {
24 return url_request_->first_party_for_cookies();
25 }
26
27 const GURL AppCacheURLRequest::GetReferrer() const {
28 return GURL(url_request_->referrer());
29 }
30
31 bool AppCacheURLRequest::IsSuccess() const {
32 return url_request_->status().is_success();
33 }
34
35 bool AppCacheURLRequest::IsCancelled() const {
36 return url_request_->status().status() == net::URLRequestStatus::CANCELED;
37 }
38
39 bool AppCacheURLRequest::IsError() const {
40 return !url_request_->status().is_success();
41 }
42
43 int AppCacheURLRequest::GetResponseCode() const {
44 return url_request_->GetResponseCode();
45 }
46
47 std::string AppCacheURLRequest::GetResponseHeaderByName(
48 const std::string& name) const {
49 std::string header;
50 url_request_->GetResponseHeaderByName(name, &header);
51 return header;
52 }
53
54 net::URLRequest* AppCacheURLRequest::GetURLRequest() const {
55 return url_request_;
56 }
57
58 AppCacheURLRequest::AppCacheURLRequest(net::URLRequest* url_request)
59 : url_request_(url_request) {}
60
61 AppCacheURLRequest::~AppCacheURLRequest() {}
62
63 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698