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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 // Used to write into an existing IOBuffer at a given offset. | 62 // Used to write into an existing IOBuffer at a given offset. |
63 class DependentIOBuffer : public net::WrappedIOBuffer { | 63 class DependentIOBuffer : public net::WrappedIOBuffer { |
64 public: | 64 public: |
65 DependentIOBuffer(net::IOBuffer* buf, int offset) | 65 DependentIOBuffer(net::IOBuffer* buf, int offset) |
66 : net::WrappedIOBuffer(buf->data() + offset), | 66 : net::WrappedIOBuffer(buf->data() + offset), |
67 buf_(buf) { | 67 buf_(buf) { |
68 } | 68 } |
69 | 69 |
70 private: | 70 private: |
71 ~DependentIOBuffer() {} | 71 virtual ~DependentIOBuffer() {} |
72 | 72 |
73 scoped_refptr<net::IOBuffer> buf_; | 73 scoped_refptr<net::IOBuffer> buf_; |
74 }; | 74 }; |
75 | 75 |
76 } // namespace | 76 } // namespace |
77 | 77 |
78 BufferedResourceHandler::BufferedResourceHandler( | 78 BufferedResourceHandler::BufferedResourceHandler( |
79 scoped_ptr<ResourceHandler> next_handler, | 79 scoped_ptr<ResourceHandler> next_handler, |
80 ResourceDispatcherHostImpl* host, | 80 ResourceDispatcherHostImpl* host, |
81 net::URLRequest* request) | 81 net::URLRequest* request) |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 const std::vector<webkit::WebPluginInfo>& plugins) { | 458 const std::vector<webkit::WebPluginInfo>& plugins) { |
459 bool defer = false; | 459 bool defer = false; |
460 if (!ProcessResponse(&defer)) { | 460 if (!ProcessResponse(&defer)) { |
461 controller()->Cancel(); | 461 controller()->Cancel(); |
462 } else if (!defer) { | 462 } else if (!defer) { |
463 controller()->Resume(); | 463 controller()->Resume(); |
464 } | 464 } |
465 } | 465 } |
466 | 466 |
467 } // namespace content | 467 } // namespace content |
OLD | NEW |