| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_STREAM_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_STREAM_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_LOADER_STREAM_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_LOADER_STREAM_RESOURCE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 std::unique_ptr<ResourceController> controller) override; | 39 std::unique_ptr<ResourceController> controller) override; |
| 40 | 40 |
| 41 void OnResponseStarted( | 41 void OnResponseStarted( |
| 42 ResourceResponse* resp, | 42 ResourceResponse* resp, |
| 43 std::unique_ptr<ResourceController> controller) override; | 43 std::unique_ptr<ResourceController> controller) override; |
| 44 | 44 |
| 45 void OnWillStart(const GURL& url, | 45 void OnWillStart(const GURL& url, |
| 46 std::unique_ptr<ResourceController> controller) override; | 46 std::unique_ptr<ResourceController> controller) override; |
| 47 | 47 |
| 48 // Create a new buffer to store received data. | 48 // Create a new buffer to store received data. |
| 49 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, | 49 void OnWillRead(scoped_refptr<net::IOBuffer>* buf, |
| 50 int* buf_size) override; | 50 int* buf_size, |
| 51 std::unique_ptr<ResourceController> controller) override; |
| 51 | 52 |
| 52 // A read was completed, forward the data to the Stream. | 53 // A read was completed, forward the data to the Stream. |
| 53 void OnReadCompleted(int bytes_read, | 54 void OnReadCompleted(int bytes_read, |
| 54 std::unique_ptr<ResourceController> controller) override; | 55 std::unique_ptr<ResourceController> controller) override; |
| 55 | 56 |
| 56 void OnResponseCompleted( | 57 void OnResponseCompleted( |
| 57 const net::URLRequestStatus& status, | 58 const net::URLRequestStatus& status, |
| 58 std::unique_ptr<ResourceController> controller) override; | 59 std::unique_ptr<ResourceController> controller) override; |
| 59 | 60 |
| 60 void OnDataDownloaded(int bytes_downloaded) override; | 61 void OnDataDownloaded(int bytes_downloaded) override; |
| 61 | 62 |
| 62 Stream* stream() { return writer_.stream(); } | 63 Stream* stream() { return writer_.stream(); } |
| 63 | 64 |
| 64 private: | 65 private: |
| 65 StreamWriter writer_; | 66 StreamWriter writer_; |
| 66 | 67 |
| 67 DISALLOW_COPY_AND_ASSIGN(StreamResourceHandler); | 68 DISALLOW_COPY_AND_ASSIGN(StreamResourceHandler); |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 } // namespace content | 71 } // namespace content |
| 71 | 72 |
| 72 #endif // CONTENT_BROWSER_LOADER_STREAM_RESOURCE_HANDLER_H_ | 73 #endif // CONTENT_BROWSER_LOADER_STREAM_RESOURCE_HANDLER_H_ |
| OLD | NEW |