| 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 "webkit/glue/resource_fetcher.h" | 5 #include "webkit/glue/resource_fetcher.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "webkit/api/public/WebFrame.h" | 8 #include "webkit/api/public/WebFrame.h" |
| 9 #include "webkit/api/public/WebKit.h" | 9 #include "webkit/api/public/WebKit.h" |
| 10 #include "webkit/api/public/WebKitClient.h" | 10 #include "webkit/api/public/WebKitClient.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 unsigned long long total_bytes_to_be_sent) { | 66 unsigned long long total_bytes_to_be_sent) { |
| 67 } | 67 } |
| 68 | 68 |
| 69 void ResourceFetcher::didReceiveResponse( | 69 void ResourceFetcher::didReceiveResponse( |
| 70 WebURLLoader* loader, const WebURLResponse& response) { | 70 WebURLLoader* loader, const WebURLResponse& response) { |
| 71 DCHECK(!completed_); | 71 DCHECK(!completed_); |
| 72 response_ = response; | 72 response_ = response; |
| 73 } | 73 } |
| 74 | 74 |
| 75 void ResourceFetcher::didReceiveData( | 75 void ResourceFetcher::didReceiveData( |
| 76 WebURLLoader* loader, const char* data, int data_length, | 76 WebURLLoader* loader, const char* data, int data_length) { |
| 77 long long total_data_length) { | |
| 78 DCHECK(!completed_); | 77 DCHECK(!completed_); |
| 79 DCHECK(data_length > 0); | 78 DCHECK(data_length > 0); |
| 80 | 79 |
| 81 data_.append(data, data_length); | 80 data_.append(data, data_length); |
| 82 } | 81 } |
| 83 | 82 |
| 84 void ResourceFetcher::didFinishLoading(WebURLLoader* loader) { | 83 void ResourceFetcher::didFinishLoading(WebURLLoader* loader) { |
| 85 DCHECK(!completed_); | 84 DCHECK(!completed_); |
| 86 completed_ = true; | 85 completed_ = true; |
| 87 | 86 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 113 } | 112 } |
| 114 | 113 |
| 115 void ResourceFetcherWithTimeout::TimeoutFired() { | 114 void ResourceFetcherWithTimeout::TimeoutFired() { |
| 116 if (!completed_) { | 115 if (!completed_) { |
| 117 loader_->cancel(); | 116 loader_->cancel(); |
| 118 didFail(NULL, WebURLError()); | 117 didFail(NULL, WebURLError()); |
| 119 } | 118 } |
| 120 } | 119 } |
| 121 | 120 |
| 122 } // namespace webkit_glue | 121 } // namespace webkit_glue |
| OLD | NEW |