| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "net/url_request/mime_sniffer_proxy.h" | 5 #include "net/url_request/mime_sniffer_proxy.h" |
| 6 | 6 |
| 7 #include "net/base/io_buffer.h" |
| 7 #include "net/base/mime_sniffer.h" | 8 #include "net/base/mime_sniffer.h" |
| 8 | 9 |
| 9 static const int kBufferSize = 1024; | 10 static const int kBufferSize = 1024; |
| 10 | 11 |
| 11 MimeSnifferProxy::MimeSnifferProxy(URLRequest* request, | 12 MimeSnifferProxy::MimeSnifferProxy(URLRequest* request, |
| 12 URLRequest::Delegate* delegate) | 13 URLRequest::Delegate* delegate) |
| 13 : request_(request), delegate_(delegate), | 14 : request_(request), delegate_(delegate), |
| 14 sniff_content_(false), error_(false), | 15 sniff_content_(false), error_(false), |
| 15 buf_(new net::IOBuffer(kBufferSize)) { | 16 buf_(new net::IOBuffer(kBufferSize)) { |
| 16 request->set_delegate(this); | 17 request->set_delegate(this); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 type_hint, &mime_type_); | 66 type_hint, &mime_type_); |
| 66 } else { | 67 } else { |
| 67 error_ = true; | 68 error_ = true; |
| 68 } | 69 } |
| 69 delegate_->OnResponseStarted(request_); | 70 delegate_->OnResponseStarted(request_); |
| 70 return; | 71 return; |
| 71 } | 72 } |
| 72 delegate_->OnReadCompleted(request, bytes_read); | 73 delegate_->OnReadCompleted(request, bytes_read); |
| 73 } | 74 } |
| 74 | 75 |
| OLD | NEW |