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

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

Issue 25536005: Clean up ResourceHandler API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_LAYERED_RESOURCE_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_LOADER_LAYERED_RESOURCE_HANDLER_H_
6 #define CONTENT_BROWSER_LOADER_LAYERED_RESOURCE_HANDLER_H_ 6 #define CONTENT_BROWSER_LOADER_LAYERED_RESOURCE_HANDLER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "content/browser/loader/resource_handler.h" 9 #include "content/browser/loader/resource_handler.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 11
12 namespace net {
13 class URLRequest;
14 } // namespace net
15
12 namespace content { 16 namespace content {
13 17
14 // A ResourceHandler that simply delegates all calls to a next handler. This 18 // A ResourceHandler that simply delegates all calls to a next handler. This
15 // class is intended to be subclassed. 19 // class is intended to be subclassed.
16 class CONTENT_EXPORT LayeredResourceHandler : public ResourceHandler { 20 class CONTENT_EXPORT LayeredResourceHandler : public ResourceHandler {
17 public: 21 public:
18 explicit LayeredResourceHandler(scoped_ptr<ResourceHandler> next_handler); 22 LayeredResourceHandler(net::URLRequest* request,
23 scoped_ptr<ResourceHandler> next_handler);
19 virtual ~LayeredResourceHandler(); 24 virtual ~LayeredResourceHandler();
20 25
21 // ResourceHandler implementation: 26 // ResourceHandler implementation:
22 virtual void SetController(ResourceController* controller) OVERRIDE; 27 virtual void SetController(ResourceController* controller) OVERRIDE;
23 virtual bool OnUploadProgress(int request_id, uint64 position, 28 virtual bool OnUploadProgress(int request_id, uint64 position,
24 uint64 size) OVERRIDE; 29 uint64 size) OVERRIDE;
25 virtual bool OnRequestRedirected(int request_id, const GURL& url, 30 virtual bool OnRequestRedirected(int request_id, const GURL& url,
26 ResourceResponse* response, 31 ResourceResponse* response,
27 bool* defer) OVERRIDE; 32 bool* defer) OVERRIDE;
28 virtual bool OnResponseStarted(int request_id, 33 virtual bool OnResponseStarted(int request_id,
29 ResourceResponse* response, 34 ResourceResponse* response,
30 bool* defer) OVERRIDE; 35 bool* defer) OVERRIDE;
31 virtual bool OnWillStart(int request_id, const GURL& url, 36 virtual bool OnWillStart(int request_id, const GURL& url,
32 bool* defer) OVERRIDE; 37 bool* defer) OVERRIDE;
33 virtual bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size, 38 virtual bool OnWillRead(int request_id,
39 scoped_refptr<net::IOBuffer>* buf,
40 int* buf_size,
34 int min_size) OVERRIDE; 41 int min_size) OVERRIDE;
35 virtual bool OnReadCompleted(int request_id, int bytes_read, 42 virtual bool OnReadCompleted(int request_id, int bytes_read,
36 bool* defer) OVERRIDE; 43 bool* defer) OVERRIDE;
37 virtual bool OnResponseCompleted(int request_id, 44 virtual bool OnResponseCompleted(int request_id,
38 const net::URLRequestStatus& status, 45 const net::URLRequestStatus& status,
39 const std::string& security_info) OVERRIDE; 46 const std::string& security_info) OVERRIDE;
40 virtual void OnDataDownloaded(int request_id, int bytes_downloaded) OVERRIDE; 47 virtual void OnDataDownloaded(int request_id, int bytes_downloaded) OVERRIDE;
41 48
42 scoped_ptr<ResourceHandler> next_handler_; 49 scoped_ptr<ResourceHandler> next_handler_;
43 }; 50 };
44 51
45 } // namespace content 52 } // namespace content
46 53
47 #endif // CONTENT_BROWSER_LOADER_LAYERED_RESOURCE_HANDLER_H_ 54 #endif // CONTENT_BROWSER_LOADER_LAYERED_RESOURCE_HANDLER_H_
OLDNEW
« no previous file with comments | « content/browser/loader/cross_site_resource_handler.cc ('k') | content/browser/loader/layered_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698