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

Side by Side Diff: content/browser/loader/detachable_resource_handler.h

Issue 667943003: Standardize usage of virtual/override/final in content/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_
6 #define CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_ 6 #define CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 19 matching lines...) Expand all
30 // cancelled. 30 // cancelled.
31 // 31 //
32 // Note that, once detached, the request continues without the original next 32 // Note that, once detached, the request continues without the original next
33 // handler, so any policy decisions in that handler are skipped. 33 // handler, so any policy decisions in that handler are skipped.
34 class DetachableResourceHandler : public ResourceHandler, 34 class DetachableResourceHandler : public ResourceHandler,
35 public ResourceController { 35 public ResourceController {
36 public: 36 public:
37 DetachableResourceHandler(net::URLRequest* request, 37 DetachableResourceHandler(net::URLRequest* request,
38 base::TimeDelta cancel_delay, 38 base::TimeDelta cancel_delay,
39 scoped_ptr<ResourceHandler> next_handler); 39 scoped_ptr<ResourceHandler> next_handler);
40 virtual ~DetachableResourceHandler(); 40 ~DetachableResourceHandler() override;
41 41
42 bool is_detached() const { return next_handler_ == NULL; } 42 bool is_detached() const { return next_handler_ == NULL; }
43 void Detach(); 43 void Detach();
44 44
45 void set_cancel_delay(base::TimeDelta cancel_delay) { 45 void set_cancel_delay(base::TimeDelta cancel_delay) {
46 cancel_delay_ = cancel_delay; 46 cancel_delay_ = cancel_delay;
47 } 47 }
48 48
49 // ResourceHandler implementation: 49 // ResourceHandler implementation:
50 virtual void SetController(ResourceController* controller) override; 50 void SetController(ResourceController* controller) override;
51 virtual bool OnUploadProgress(uint64 position, uint64 size) override; 51 bool OnUploadProgress(uint64 position, uint64 size) override;
52 virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, 52 bool OnRequestRedirected(const net::RedirectInfo& redirect_info,
53 ResourceResponse* response, 53 ResourceResponse* response,
54 bool* defer) override; 54 bool* defer) override;
55 virtual bool OnResponseStarted(ResourceResponse* response, 55 bool OnResponseStarted(ResourceResponse* response, bool* defer) override;
56 bool* defer) override; 56 bool OnWillStart(const GURL& url, bool* defer) override;
57 virtual bool OnWillStart(const GURL& url, bool* defer) override; 57 bool OnBeforeNetworkStart(const GURL& url, bool* defer) override;
58 virtual bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; 58 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf,
59 virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, 59 int* buf_size,
60 int* buf_size, 60 int min_size) override;
61 int min_size) override; 61 bool OnReadCompleted(int bytes_read, bool* defer) override;
62 virtual bool OnReadCompleted(int bytes_read, bool* defer) override; 62 void OnResponseCompleted(const net::URLRequestStatus& status,
63 virtual void OnResponseCompleted(const net::URLRequestStatus& status, 63 const std::string& security_info,
64 const std::string& security_info, 64 bool* defer) override;
65 bool* defer) override; 65 void OnDataDownloaded(int bytes_downloaded) override;
66 virtual void OnDataDownloaded(int bytes_downloaded) override;
67 66
68 // ResourceController implementation: 67 // ResourceController implementation:
69 virtual void Resume() override; 68 void Resume() override;
70 virtual void Cancel() override; 69 void Cancel() override;
71 virtual void CancelAndIgnore() override; 70 void CancelAndIgnore() override;
72 virtual void CancelWithError(int error_code) override; 71 void CancelWithError(int error_code) override;
73 72
74 private: 73 private:
75 scoped_ptr<ResourceHandler> next_handler_; 74 scoped_ptr<ResourceHandler> next_handler_;
76 scoped_refptr<net::IOBuffer> read_buffer_; 75 scoped_refptr<net::IOBuffer> read_buffer_;
77 76
78 scoped_ptr<base::OneShotTimer<DetachableResourceHandler> > detached_timer_; 77 scoped_ptr<base::OneShotTimer<DetachableResourceHandler> > detached_timer_;
79 base::TimeDelta cancel_delay_; 78 base::TimeDelta cancel_delay_;
80 79
81 bool is_deferred_; 80 bool is_deferred_;
82 bool is_finished_; 81 bool is_finished_;
83 82
84 DISALLOW_COPY_AND_ASSIGN(DetachableResourceHandler); 83 DISALLOW_COPY_AND_ASSIGN(DetachableResourceHandler);
85 }; 84 };
86 85
87 } // namespace content 86 } // namespace content
88 87
89 #endif // CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_ 88 #endif // CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_
OLDNEW
« no previous file with comments | « content/browser/loader/cross_site_resource_handler.h ('k') | content/browser/loader/layered_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698