blob: 6c37dff5b0e43ac734e5e58f119eddc39b231801 [file] [log] [blame]
[email protected]d18720a2012-01-06 09:53:551// 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
3// found in the LICENSE file.
4
[email protected]678c0362012-12-05 08:02:445#ifndef CONTENT_BROWSER_LOADER_LAYERED_RESOURCE_HANDLER_H_
6#define CONTENT_BROWSER_LOADER_LAYERED_RESOURCE_HANDLER_H_
[email protected]d18720a2012-01-06 09:53:557
[email protected]d651cbc2012-05-31 21:33:058#include "base/memory/scoped_ptr.h"
[email protected]678c0362012-12-05 08:02:449#include "content/browser/loader/resource_handler.h"
[email protected]62b4a962012-01-18 22:53:1610#include "content/common/content_export.h"
[email protected]d18720a2012-01-06 09:53:5511
[email protected]ef5306e2013-10-15 19:38:1812namespace net {
13class URLRequest;
14} // namespace net
15
[email protected]d18720a2012-01-06 09:53:5516namespace content {
17
18// A ResourceHandler that simply delegates all calls to a next handler. This
19// class is intended to be subclassed.
[email protected]62b4a962012-01-18 22:53:1620class CONTENT_EXPORT LayeredResourceHandler : public ResourceHandler {
[email protected]d18720a2012-01-06 09:53:5521 public:
[email protected]ef5306e2013-10-15 19:38:1822 LayeredResourceHandler(net::URLRequest* request,
23 scoped_ptr<ResourceHandler> next_handler);
dchengc2282aa2014-10-21 12:07:5824 ~LayeredResourceHandler() override;
[email protected]d18720a2012-01-06 09:53:5525
26 // ResourceHandler implementation:
dchengc2282aa2014-10-21 12:07:5827 void SetController(ResourceController* controller) override;
dchengc2282aa2014-10-21 12:07:5828 bool OnRequestRedirected(const net::RedirectInfo& redirect_info,
29 ResourceResponse* response,
30 bool* defer) override;
31 bool OnResponseStarted(ResourceResponse* response, bool* defer) override;
32 bool OnWillStart(const GURL& url, bool* defer) override;
33 bool OnBeforeNetworkStart(const GURL& url, bool* defer) override;
34 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf,
35 int* buf_size,
36 int min_size) override;
37 bool OnReadCompleted(int bytes_read, bool* defer) override;
38 void OnResponseCompleted(const net::URLRequestStatus& status,
39 const std::string& security_info,
40 bool* defer) override;
41 void OnDataDownloaded(int bytes_downloaded) override;
[email protected]d18720a2012-01-06 09:53:5542
[email protected]d651cbc2012-05-31 21:33:0543 scoped_ptr<ResourceHandler> next_handler_;
[email protected]d18720a2012-01-06 09:53:5544};
45
46} // namespace content
47
[email protected]678c0362012-12-05 08:02:4448#endif // CONTENT_BROWSER_LOADER_LAYERED_RESOURCE_HANDLER_H_