| 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 "config.h" | 5 #include "config.h" |
| 6 #include "webkit/glue/resource_fetcher.h" | 6 #include "webkit/glue/resource_fetcher.h" |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 | 9 |
| 10 MSVC_PUSH_WARNING_LEVEL(0); | 10 MSVC_PUSH_WARNING_LEVEL(0); |
| 11 #include "FrameLoader.h" | 11 #include "FrameLoader.h" |
| 12 #include "FrameLoaderClient.h" |
| 12 #include "ResourceHandle.h" | 13 #include "ResourceHandle.h" |
| 13 #include "ResourceRequest.h" | 14 #include "ResourceRequest.h" |
| 14 MSVC_POP_WARNING(); | 15 MSVC_POP_WARNING(); |
| 15 | 16 |
| 16 #undef LOG | 17 #undef LOG |
| 17 #include "base/logging.h" | 18 #include "base/logging.h" |
| 18 #include "webkit/glue/glue_util.h" | 19 #include "webkit/glue/glue_util.h" |
| 19 #include "net/url_request/url_request_status.h" | 20 #include "net/url_request/url_request_status.h" |
| 20 | 21 |
| 21 using WebCore::ResourceError; | 22 using WebCore::ResourceError; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 49 if (!frame_loader) { | 50 if (!frame_loader) { |
| 50 // We put this on a 0 timer so the callback happens async (consistent with | 51 // We put this on a 0 timer so the callback happens async (consistent with |
| 51 // regular fetches). | 52 // regular fetches). |
| 52 start_failed_timer_.reset(new StartFailedTimer(this, | 53 start_failed_timer_.reset(new StartFailedTimer(this, |
| 53 &ResourceFetcher::StartFailed)); | 54 &ResourceFetcher::StartFailed)); |
| 54 start_failed_timer_->startOneShot(0); | 55 start_failed_timer_->startOneShot(0); |
| 55 return; | 56 return; |
| 56 } | 57 } |
| 57 | 58 |
| 58 WebCore::ResourceRequest request(webkit_glue::GURLToKURL(url_)); | 59 WebCore::ResourceRequest request(webkit_glue::GURLToKURL(url_)); |
| 59 request.setFrame(frame); | 60 WebCore::ResourceResponse response; |
| 61 frame_loader->client()->dispatchWillSendRequest(NULL, 0, request, response); |
| 60 | 62 |
| 61 loader_ = ResourceHandle::create(request, this, NULL, false, false); | 63 loader_ = ResourceHandle::create(request, this, NULL, false, false); |
| 62 } | 64 } |
| 63 | 65 |
| 64 void ResourceFetcher::StartFailed(StartFailedTimer* timer) { | 66 void ResourceFetcher::StartFailed(StartFailedTimer* timer) { |
| 65 didFail(NULL, ResourceError()); | 67 didFail(NULL, ResourceError()); |
| 66 } | 68 } |
| 67 | 69 |
| 68 ///////////////////////////////////////////////////////////////////////////// | 70 ///////////////////////////////////////////////////////////////////////////// |
| 69 // ResourceHandleClient methods | 71 // ResourceHandleClient methods |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 &ResourceFetcherWithTimeout::TimeoutFired)); | 116 &ResourceFetcherWithTimeout::TimeoutFired)); |
| 115 timeout_timer_->startOneShot(timeout_secs); | 117 timeout_timer_->startOneShot(timeout_secs); |
| 116 } | 118 } |
| 117 | 119 |
| 118 void ResourceFetcherWithTimeout::TimeoutFired(FetchTimer* timer) { | 120 void ResourceFetcherWithTimeout::TimeoutFired(FetchTimer* timer) { |
| 119 if (!completed_) { | 121 if (!completed_) { |
| 120 loader_->cancel(); | 122 loader_->cancel(); |
| 121 didFail(NULL, ResourceError()); | 123 didFail(NULL, ResourceError()); |
| 122 } | 124 } |
| 123 } | 125 } |
| OLD | NEW |