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 #include "content/browser/loader/stream_resource_handler.h" | 5 #include "content/browser/loader/stream_resource_handler.h" |
6 | 6 |
7 #include "base/guid.h" | 7 #include "base/guid.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "content/browser/streams/stream.h" | 9 #include "content/browser/streams/stream.h" |
10 #include "content/browser/streams/stream_registry.h" | 10 #include "content/browser/streams/stream_registry.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 bool* defer) { | 50 bool* defer) { |
51 return true; | 51 return true; |
52 } | 52 } |
53 | 53 |
54 bool StreamResourceHandler::OnWillStart(int request_id, | 54 bool StreamResourceHandler::OnWillStart(int request_id, |
55 const GURL& url, | 55 const GURL& url, |
56 bool* defer) { | 56 bool* defer) { |
57 return true; | 57 return true; |
58 } | 58 } |
59 | 59 |
| 60 bool StreamResourceHandler::OnBeforeNetworkStart(int request_id, |
| 61 const GURL& url, |
| 62 bool* defer) { |
| 63 return true; |
| 64 } |
| 65 |
60 bool StreamResourceHandler::OnWillRead(int request_id, | 66 bool StreamResourceHandler::OnWillRead(int request_id, |
61 scoped_refptr<net::IOBuffer>* buf, | 67 scoped_refptr<net::IOBuffer>* buf, |
62 int* buf_size, | 68 int* buf_size, |
63 int min_size) { | 69 int min_size) { |
64 static const int kReadBufSize = 32768; | 70 static const int kReadBufSize = 32768; |
65 | 71 |
66 DCHECK(buf && buf_size); | 72 DCHECK(buf && buf_size); |
67 if (!read_buffer_.get()) | 73 if (!read_buffer_.get()) |
68 read_buffer_ = new net::IOBuffer(kReadBufSize); | 74 read_buffer_ = new net::IOBuffer(kReadBufSize); |
69 *buf = read_buffer_.get(); | 75 *buf = read_buffer_.get(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 115 |
110 void StreamResourceHandler::OnSpaceAvailable(Stream* stream) { | 116 void StreamResourceHandler::OnSpaceAvailable(Stream* stream) { |
111 controller()->Resume(); | 117 controller()->Resume(); |
112 } | 118 } |
113 | 119 |
114 void StreamResourceHandler::OnClose(Stream* stream) { | 120 void StreamResourceHandler::OnClose(Stream* stream) { |
115 controller()->Cancel(); | 121 controller()->Cancel(); |
116 } | 122 } |
117 | 123 |
118 } // namespace content | 124 } // namespace content |
OLD | NEW |