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

Side by Side Diff: headless/public/util/generic_url_request_job.h

Issue 2746093002: Remove obsolete methods from GenericURLRequestJob::Delegate (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | headless/public/util/generic_url_request_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 HEADLESS_PUBLIC_UTIL_GENERIC_URL_REQUEST_JOB_H_ 5 #ifndef HEADLESS_PUBLIC_UTIL_GENERIC_URL_REQUEST_JOB_H_
6 #define HEADLESS_PUBLIC_UTIL_GENERIC_URL_REQUEST_JOB_H_ 6 #define HEADLESS_PUBLIC_UTIL_GENERIC_URL_REQUEST_JOB_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <functional> 9 #include <functional>
10 #include <memory> 10 #include <memory>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 class Delegate { 54 class Delegate {
55 public: 55 public:
56 // Allows the delegate to rewrite the URL for a given request. Return true 56 // Allows the delegate to rewrite the URL for a given request. Return true
57 // to signal that the rewrite is in progress and |callback| will be called 57 // to signal that the rewrite is in progress and |callback| will be called
58 // with the result, or false to indicate that no rewriting is necessary. 58 // with the result, or false to indicate that no rewriting is necessary.
59 // Called on an arbitrary thread. 59 // Called on an arbitrary thread.
60 virtual bool BlockOrRewriteRequest(const GURL& url, 60 virtual bool BlockOrRewriteRequest(const GURL& url,
61 const std::string& devtools_id, 61 const std::string& devtools_id,
62 const std::string& method, 62 const std::string& method,
63 const std::string& referrer, 63 const std::string& referrer,
64 RewriteCallback callback); 64 RewriteCallback callback) = 0;
65 // TODO(alexclarke): Make the above pure virtual and remove this.
66 virtual bool BlockOrRewriteRequest(const GURL& url,
67 const std::string& method,
68 const std::string& referrer,
69 RewriteCallback callback);
70 65
71 // Allows the delegate to synchronously fulfill a request with a reply. 66 // Allows the delegate to synchronously fulfill a request with a reply.
72 // Called on an arbitrary thread. 67 // Called on an arbitrary thread.
73 virtual const HttpResponse* MaybeMatchResource( 68 virtual const HttpResponse* MaybeMatchResource(
74 const GURL& url, 69 const GURL& url,
75 const std::string& devtools_id, 70 const std::string& devtools_id,
76 const std::string& method, 71 const std::string& method,
77 const net::HttpRequestHeaders& request_headers); 72 const net::HttpRequestHeaders& request_headers) = 0;
78 // TODO(alexclarke): Make the above pure virtual and remove this.
79 virtual const HttpResponse* MaybeMatchResource(
80 const GURL& url,
81 const std::string& method,
82 const net::HttpRequestHeaders& request_headers);
83 73
84 // Signals that a resource load has finished. Called on an arbitrary thread. 74 // Signals that a resource load has finished. Called on an arbitrary thread.
85 virtual void OnResourceLoadComplete(const GURL& final_url, 75 virtual void OnResourceLoadComplete(const GURL& final_url,
86 const std::string& devtools_id, 76 const std::string& devtools_id,
87 const std::string& mime_type, 77 const std::string& mime_type,
88 int http_response_code); 78 int http_response_code) = 0;
89 // TODO(alexclarke): Make the above pure virtual and remove this.
90 virtual void OnResourceLoadComplete(const GURL& final_url,
91 const std::string& mime_type,
92 int http_response_code) {}
93 79
94 protected: 80 protected:
95 virtual ~Delegate() {} 81 virtual ~Delegate() {}
96 }; 82 };
97 83
98 // NOTE |url_request_dispatcher| and |delegate| must outlive the 84 // NOTE |url_request_dispatcher| and |delegate| must outlive the
99 // GenericURLRequestJob. 85 // GenericURLRequestJob.
100 GenericURLRequestJob(net::URLRequest* request, 86 GenericURLRequestJob(net::URLRequest* request,
101 net::NetworkDelegate* network_delegate, 87 net::NetworkDelegate* network_delegate,
102 URLRequestDispatcher* url_request_dispatcher, 88 URLRequestDispatcher* url_request_dispatcher,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 base::TimeTicks response_time_; 129 base::TimeTicks response_time_;
144 130
145 base::WeakPtrFactory<GenericURLRequestJob> weak_factory_; 131 base::WeakPtrFactory<GenericURLRequestJob> weak_factory_;
146 132
147 DISALLOW_COPY_AND_ASSIGN(GenericURLRequestJob); 133 DISALLOW_COPY_AND_ASSIGN(GenericURLRequestJob);
148 }; 134 };
149 135
150 } // namespace headless 136 } // namespace headless
151 137
152 #endif // HEADLESS_PUBLIC_UTIL_GENERIC_URL_REQUEST_JOB_H_ 138 #endif // HEADLESS_PUBLIC_UTIL_GENERIC_URL_REQUEST_JOB_H_
OLDNEW
« no previous file with comments | « no previous file | headless/public/util/generic_url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698