| 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 "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 | 80 |
| 81 void ResourceFetcher::didReceiveResponse( | 81 void ResourceFetcher::didReceiveResponse( |
| 82 WebURLLoader* loader, const WebURLResponse& response) { | 82 WebURLLoader* loader, const WebURLResponse& response) { |
| 83 DCHECK(!completed_); | 83 DCHECK(!completed_); |
| 84 response_ = response; | 84 response_ = response; |
| 85 } | 85 } |
| 86 | 86 |
| 87 void ResourceFetcher::didReceiveData( | 87 void ResourceFetcher::didReceiveData( |
| 88 WebURLLoader* loader, const char* data, int data_length, | 88 WebURLLoader* loader, const char* data, int data_length, |
| 89 int length_received) { | 89 int raw_data_length) { |
| 90 DCHECK(!completed_); | 90 DCHECK(!completed_); |
| 91 DCHECK(data_length > 0); | 91 DCHECK(data_length > 0); |
| 92 | 92 |
| 93 data_.append(data, data_length); | 93 data_.append(data, data_length); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void ResourceFetcher::didReceiveCachedMetadata( | 96 void ResourceFetcher::didReceiveCachedMetadata( |
| 97 WebURLLoader* loader, const char* data, int data_length) { | 97 WebURLLoader* loader, const char* data, int data_length) { |
| 98 DCHECK(!completed_); | 98 DCHECK(!completed_); |
| 99 DCHECK(data_length > 0); | 99 DCHECK(data_length > 0); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 131 } |
| 132 | 132 |
| 133 void ResourceFetcherWithTimeout::TimeoutFired() { | 133 void ResourceFetcherWithTimeout::TimeoutFired() { |
| 134 if (!completed_) { | 134 if (!completed_) { |
| 135 loader_->cancel(); | 135 loader_->cancel(); |
| 136 didFail(NULL, WebURLError()); | 136 didFail(NULL, WebURLError()); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace webkit_glue | 140 } // namespace webkit_glue |
| OLD | NEW |