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 // This file replaces WebCore/platform/network/win/ResourceHandleWin.cpp with a | 5 // This file replaces WebCore/platform/network/win/ResourceHandleWin.cpp with a |
6 // platform-neutral implementation that simply defers almost entirely to | 6 // platform-neutral implementation that simply defers almost entirely to |
7 // ResouceLoaderBridge. | 7 // ResouceLoaderBridge. |
8 // | 8 // |
9 // This uses the same ResourceHandle.h header file that the rest of WebKit | 9 // This uses the same ResourceHandle.h header file that the rest of WebKit |
10 // uses, allowing us to avoid complicated changes. Our specific things are | 10 // uses, allowing us to avoid complicated changes. Our specific things are |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 | 709 |
710 /*static*/ bool ResourceHandle::supportsBufferedData() { | 710 /*static*/ bool ResourceHandle::supportsBufferedData() { |
711 return false; // the loader will buffer manually if it needs to | 711 return false; // the loader will buffer manually if it needs to |
712 } | 712 } |
713 | 713 |
714 /*static*/ void ResourceHandle::loadResourceSynchronously( | 714 /*static*/ void ResourceHandle::loadResourceSynchronously( |
715 const ResourceRequest& request, ResourceError& error, | 715 const ResourceRequest& request, ResourceError& error, |
716 ResourceResponse& response, Vector<char>& data, Frame*) { | 716 ResourceResponse& response, Vector<char>& data, Frame*) { |
717 | 717 |
718 RefPtr<ResourceHandle> handle = | 718 RefPtr<ResourceHandle> handle = |
719 new ResourceHandle(request, NULL, false, false, false); | 719 adoptRef(new ResourceHandle(request, NULL, false, false, false)); |
720 | 720 |
721 ResourceLoaderBridge::SyncLoadResponse sync_load_response; | 721 ResourceLoaderBridge::SyncLoadResponse sync_load_response; |
722 if (!handle->d->Start(&sync_load_response)) { | 722 if (!handle->d->Start(&sync_load_response)) { |
723 response = | 723 response = |
724 ResourceResponse(request.url(), String(), 0, String(), String()); | 724 ResourceResponse(request.url(), String(), 0, String(), String()); |
725 // TODO(darin): what should the error code really be? | 725 // TODO(darin): what should the error code really be? |
726 error = ResourceError(net::kErrorDomain, | 726 error = ResourceError(net::kErrorDomain, |
727 net::ERR_FAILED, | 727 net::ERR_FAILED, |
728 request.url().string(), | 728 request.url().string(), |
729 String() /* localized description */); | 729 String() /* localized description */); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 // if the request cannot be serviced from cache. We force the 'DontLoad' | 764 // if the request cannot be serviced from cache. We force the 'DontLoad' |
765 // cache policy at this point to ensure that we never hit the network for | 765 // cache policy at this point to ensure that we never hit the network for |
766 // this request. | 766 // this request. |
767 // | 767 // |
768 DCHECK(request.httpMethod() == "POST"); | 768 DCHECK(request.httpMethod() == "POST"); |
769 request.setCachePolicy(ReturnCacheDataDontLoad); | 769 request.setCachePolicy(ReturnCacheDataDontLoad); |
770 return true; | 770 return true; |
771 } | 771 } |
772 | 772 |
773 } // namespace WebCore | 773 } // namespace WebCore |
OLD | NEW |