1 // Copyright 2011 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 // 5 // Invalid URLs go through this URLRequestJob class rather than being 6 // passed to the default job handler. 7 8 #ifndef NET_URL_REQUEST_URL_REQUEST_ERROR_JOB_H_ 9 #define NET_URL_REQUEST_URL_REQUEST_ERROR_JOB_H_ 10 11 #include "base/memory/weak_ptr.h" 12 #include "net/base/net_export.h" 13 #include "net/url_request/url_request_job.h" 14 15 namespace net { 16 17 class NET_EXPORT URLRequestErrorJob : public URLRequestJob { 18 public: 19 URLRequestErrorJob(URLRequest* request, 20 int error); 21 ~URLRequestErrorJob() override; 22 23 void Start() override; 24 void Kill() override; 25 26 private: 27 void StartAsync(); 28 29 int error_; 30 31 base::WeakPtrFactory<URLRequestErrorJob> weak_factory_{this}; 32 }; 33 34 } // namespace net 35 36 #endif // NET_URL_REQUEST_URL_REQUEST_ERROR_JOB_H_ 37