OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/mime_sniffing_resource_handler.h" | 5 #include "content/browser/loader/mime_sniffing_resource_handler.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 bool OnReadCompleted(int bytes_read, bool* defer) override { | 86 bool OnReadCompleted(int bytes_read, bool* defer) override { |
87 DCHECK_LT(bytes_read, 2048); | 87 DCHECK_LT(bytes_read, 2048); |
88 on_read_completed_called_++; | 88 on_read_completed_called_++; |
89 if (defer_on_read_completed_) | 89 if (defer_on_read_completed_) |
90 *defer = true; | 90 *defer = true; |
91 return read_completed_succeeds_; | 91 return read_completed_succeeds_; |
92 } | 92 } |
93 | 93 |
94 void OnResponseCompleted(const net::URLRequestStatus& status, | 94 void OnResponseCompleted(const net::URLRequestStatus& status, |
95 const std::string& security_info, | |
96 bool* defer) override {} | 95 bool* defer) override {} |
97 | 96 |
98 void OnDataDownloaded(int bytes_downloaded) override { NOTREACHED(); } | 97 void OnDataDownloaded(int bytes_downloaded) override { NOTREACHED(); } |
99 | 98 |
100 scoped_refptr<net::IOBuffer> buffer() { return buffer_; } | 99 scoped_refptr<net::IOBuffer> buffer() { return buffer_; } |
101 | 100 |
102 int on_will_start_called() const { return on_will_start_called_; } | 101 int on_will_start_called() const { return on_will_start_called_; } |
103 int on_request_redirected_called() const { | 102 int on_request_redirected_called() const { |
104 return on_request_redirected_called_; | 103 return on_request_redirected_called_; |
105 } | 104 } |
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 // handle the download. | 1003 // handle the download. |
1005 bool defer = false; | 1004 bool defer = false; |
1006 mime_handler->OnResponseStarted(response.get(), &defer); | 1005 mime_handler->OnResponseStarted(response.get(), &defer); |
1007 EXPECT_FALSE(defer); | 1006 EXPECT_FALSE(defer); |
1008 EXPECT_FALSE(host.new_resource_handler()); | 1007 EXPECT_FALSE(host.new_resource_handler()); |
1009 | 1008 |
1010 content::RunAllPendingInMessageLoop(); | 1009 content::RunAllPendingInMessageLoop(); |
1011 } | 1010 } |
1012 | 1011 |
1013 } // namespace content | 1012 } // namespace content |
OLD | NEW |