Respond with QuotaExceededError when IndexedDB has no disk space on open.
[chromium-blink-merge.git] / content / browser / loader / layered_resource_handler.cc
blob872bc7a422d773469ecceea984b6f9e4b51116a3
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
3 // found in the LICENSE file.
5 #include "content/browser/loader/layered_resource_handler.h"
7 #include "base/logging.h"
9 namespace content {
11 LayeredResourceHandler::LayeredResourceHandler(
12 scoped_ptr<ResourceHandler> next_handler)
13 : next_handler_(next_handler.Pass()) {
16 LayeredResourceHandler::~LayeredResourceHandler() {
19 void LayeredResourceHandler::SetController(ResourceController* controller) {
20 ResourceHandler::SetController(controller);
22 // Pass the controller down to the next handler. This method is intended to
23 // be overriden by subclasses of LayeredResourceHandler that need to insert a
24 // different ResourceController.
26 DCHECK(next_handler_.get());
27 next_handler_->SetController(controller);
30 bool LayeredResourceHandler::OnUploadProgress(int request_id, uint64 position,
31 uint64 size) {
32 DCHECK(next_handler_.get());
33 return next_handler_->OnUploadProgress(request_id, position, size);
36 bool LayeredResourceHandler::OnRequestRedirected(int request_id,
37 const GURL& url,
38 ResourceResponse* response,
39 bool* defer) {
40 DCHECK(next_handler_.get());
41 return next_handler_->OnRequestRedirected(request_id, url, response, defer);
44 bool LayeredResourceHandler::OnResponseStarted(int request_id,
45 ResourceResponse* response,
46 bool* defer) {
47 DCHECK(next_handler_.get());
48 return next_handler_->OnResponseStarted(request_id, response, defer);
51 bool LayeredResourceHandler::OnWillStart(int request_id, const GURL& url,
52 bool* defer) {
53 DCHECK(next_handler_.get());
54 return next_handler_->OnWillStart(request_id, url, defer);
57 bool LayeredResourceHandler::OnWillRead(int request_id, net::IOBuffer** buf,
58 int* buf_size, int min_size) {
59 DCHECK(next_handler_.get());
60 return next_handler_->OnWillRead(request_id, buf, buf_size, min_size);
63 bool LayeredResourceHandler::OnReadCompleted(int request_id, int bytes_read,
64 bool* defer) {
65 DCHECK(next_handler_.get());
66 return next_handler_->OnReadCompleted(request_id, bytes_read, defer);
69 bool LayeredResourceHandler::OnResponseCompleted(
70 int request_id,
71 const net::URLRequestStatus& status,
72 const std::string& security_info) {
73 DCHECK(next_handler_.get());
74 return next_handler_->OnResponseCompleted(request_id, status, security_info);
77 void LayeredResourceHandler::OnDataDownloaded(int request_id,
78 int bytes_downloaded) {
79 DCHECK(next_handler_.get());
80 next_handler_->OnDataDownloaded(request_id, bytes_downloaded);
83 } // namespace content