Chromium Code Reviews| 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/WebKit/chromium/public/WebFrame.h" | 8 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
| 9 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" |
| 10 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 39 } | 39 } |
| 40 | 40 |
| 41 void ResourceFetcher::Cancel() { | 41 void ResourceFetcher::Cancel() { |
| 42 if (!completed_) { | 42 if (!completed_) { |
| 43 loader_->cancel(); | 43 loader_->cancel(); |
| 44 completed_ = true; | 44 completed_ = true; |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 void ResourceFetcher::Start(WebFrame* frame) { | 48 void ResourceFetcher::Start(WebFrame* frame) { |
| 49 WebURLRequest request(url_); | 49 loader_.reset(frame->createAssociatedURLLoader()); |
| 50 frame->dispatchWillSendRequest(request); | 50 loader_->loadAsynchronously(WebURLRequest(url_), this); |
|
michaeln
2010/12/07 00:27:32
I wonder about ResourceFetcher resource loads now
| |
| 51 | |
| 52 loader_.reset(WebKit::webKitClient()->createURLLoader()); | |
| 53 loader_->loadAsynchronously(request, this); | |
| 54 } | 51 } |
| 55 | 52 |
| 56 ///////////////////////////////////////////////////////////////////////////// | 53 ///////////////////////////////////////////////////////////////////////////// |
| 57 // WebURLLoaderClient methods | 54 // WebURLLoaderClient methods |
| 58 | 55 |
| 59 void ResourceFetcher::willSendRequest( | 56 void ResourceFetcher::willSendRequest( |
| 60 WebURLLoader* loader, WebURLRequest& new_request, | 57 WebURLLoader* loader, WebURLRequest& new_request, |
| 61 const WebURLResponse& redirect_response) { | 58 const WebURLResponse& redirect_response) { |
| 62 } | 59 } |
| 63 | 60 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 } | 121 } |
| 125 | 122 |
| 126 void ResourceFetcherWithTimeout::TimeoutFired() { | 123 void ResourceFetcherWithTimeout::TimeoutFired() { |
| 127 if (!completed_) { | 124 if (!completed_) { |
| 128 loader_->cancel(); | 125 loader_->cancel(); |
| 129 didFail(NULL, WebURLError()); | 126 didFail(NULL, WebURLError()); |
| 130 } | 127 } |
| 131 } | 128 } |
| 132 | 129 |
| 133 } // namespace webkit_glue | 130 } // namespace webkit_glue |
| OLD | NEW |