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 24 matching lines...) Expand all Loading... |
35 | 35 |
36 // Not needed, as this event handler ought to be the final resource. | 36 // Not needed, as this event handler ought to be the final resource. |
37 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, | 37 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, |
38 ResourceResponse* resp, | 38 ResourceResponse* resp, |
39 bool* defer) override; | 39 bool* defer) override; |
40 | 40 |
41 bool OnResponseStarted(ResourceResponse* resp, bool* defer) override; | 41 bool OnResponseStarted(ResourceResponse* resp, bool* defer) override; |
42 | 42 |
43 bool OnWillStart(const GURL& url, bool* defer) override; | 43 bool OnWillStart(const GURL& url, bool* defer) override; |
44 | 44 |
45 bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; | |
46 | |
47 // Create a new buffer to store received data. | 45 // Create a new buffer to store received data. |
48 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, | 46 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, |
49 int* buf_size, | 47 int* buf_size, |
50 int min_size) override; | 48 int min_size) override; |
51 | 49 |
52 // A read was completed, forward the data to the Stream. | 50 // A read was completed, forward the data to the Stream. |
53 bool OnReadCompleted(int bytes_read, bool* defer) override; | 51 bool OnReadCompleted(int bytes_read, bool* defer) override; |
54 | 52 |
55 void OnResponseCompleted(const net::URLRequestStatus& status, | 53 void OnResponseCompleted(const net::URLRequestStatus& status, |
56 const std::string& sec_info, | 54 const std::string& sec_info, |
57 bool* defer) override; | 55 bool* defer) override; |
58 | 56 |
59 void OnDataDownloaded(int bytes_downloaded) override; | 57 void OnDataDownloaded(int bytes_downloaded) override; |
60 | 58 |
61 Stream* stream() { return writer_.stream(); } | 59 Stream* stream() { return writer_.stream(); } |
62 | 60 |
63 private: | 61 private: |
64 StreamWriter writer_; | 62 StreamWriter writer_; |
65 | 63 |
66 DISALLOW_COPY_AND_ASSIGN(StreamResourceHandler); | 64 DISALLOW_COPY_AND_ASSIGN(StreamResourceHandler); |
67 }; | 65 }; |
68 | 66 |
69 } // namespace content | 67 } // namespace content |
70 | 68 |
71 #endif // CONTENT_BROWSER_LOADER_STREAM_RESOURCE_HANDLER_H_ | 69 #endif // CONTENT_BROWSER_LOADER_STREAM_RESOURCE_HANDLER_H_ |
OLD | NEW |