| OLD | NEW |
| 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 #include "content/browser/loader/buffered_resource_handler.h" | 5 #include "content/browser/loader/buffered_resource_handler.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 // Used to write into an existing IOBuffer at a given offset. | 67 // Used to write into an existing IOBuffer at a given offset. |
| 68 class DependentIOBuffer : public net::WrappedIOBuffer { | 68 class DependentIOBuffer : public net::WrappedIOBuffer { |
| 69 public: | 69 public: |
| 70 DependentIOBuffer(net::IOBuffer* buf, int offset) | 70 DependentIOBuffer(net::IOBuffer* buf, int offset) |
| 71 : net::WrappedIOBuffer(buf->data() + offset), | 71 : net::WrappedIOBuffer(buf->data() + offset), |
| 72 buf_(buf) { | 72 buf_(buf) { |
| 73 } | 73 } |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 virtual ~DependentIOBuffer() {} | 76 ~DependentIOBuffer() override {} |
| 77 | 77 |
| 78 scoped_refptr<net::IOBuffer> buf_; | 78 scoped_refptr<net::IOBuffer> buf_; |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace | 81 } // namespace |
| 82 | 82 |
| 83 BufferedResourceHandler::BufferedResourceHandler( | 83 BufferedResourceHandler::BufferedResourceHandler( |
| 84 scoped_ptr<ResourceHandler> next_handler, | 84 scoped_ptr<ResourceHandler> next_handler, |
| 85 ResourceDispatcherHostImpl* host, | 85 ResourceDispatcherHostImpl* host, |
| 86 net::URLRequest* request) | 86 net::URLRequest* request) |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 request()->LogUnblocked(); | 494 request()->LogUnblocked(); |
| 495 bool defer = false; | 495 bool defer = false; |
| 496 if (!ProcessResponse(&defer)) { | 496 if (!ProcessResponse(&defer)) { |
| 497 controller()->Cancel(); | 497 controller()->Cancel(); |
| 498 } else if (!defer) { | 498 } else if (!defer) { |
| 499 controller()->Resume(); | 499 controller()->Resume(); |
| 500 } | 500 } |
| 501 } | 501 } |
| 502 | 502 |
| 503 } // namespace content | 503 } // namespace content |
| OLD | NEW |