OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // A succesful load will consist of: | 62 // A succesful load will consist of: |
63 // 0+ willFollowRedirect() | 63 // 0+ willFollowRedirect() |
64 // 0+ didSendData() | 64 // 0+ didSendData() |
65 // 1 didReceiveResponse() | 65 // 1 didReceiveResponse() |
66 // 0-1 didReceiveCachedMetadata() | 66 // 0-1 didReceiveCachedMetadata() |
67 // 0+ didReceiveData() or didDownloadData(), but never both | 67 // 0+ didReceiveData() or didDownloadData(), but never both |
68 // 1 didFinishLoading() | 68 // 1 didFinishLoading() |
69 // A failed load is indicated by 1 didFail(), which can occur at any time | 69 // A failed load is indicated by 1 didFail(), which can occur at any time |
70 // before didFinishLoading(), including synchronous inside one of the other | 70 // before didFinishLoading(), including synchronous inside one of the other |
71 // callbacks via ResourceLoader::cancel() | 71 // callbacks via ResourceLoader::cancel() |
72 void willFollowRedirect(WebURLLoader*, WebURLRequest&, const WebURLResponse&
redirectResponse, int64_t encodedDataLength) override; | 72 bool willFollowRedirect(WebURLLoader*, WebURLRequest&, const WebURLResponse&
redirectResponse, int64_t encodedDataLength) override; |
73 void didSendData(WebURLLoader*, unsigned long long bytesSent, unsigned long
long totalBytesToBeSent) override; | 73 void didSendData(WebURLLoader*, unsigned long long bytesSent, unsigned long
long totalBytesToBeSent) override; |
74 void didReceiveResponse(WebURLLoader*, const WebURLResponse&) override; | 74 void didReceiveResponse(WebURLLoader*, const WebURLResponse&) override; |
75 void didReceiveResponse(WebURLLoader*, const WebURLResponse&, WebDataConsume
rHandle*) override; | 75 void didReceiveResponse(WebURLLoader*, const WebURLResponse&, WebDataConsume
rHandle*) override; |
76 void didReceiveCachedMetadata(WebURLLoader*, const char* data, int length) o
verride; | 76 void didReceiveCachedMetadata(WebURLLoader*, const char* data, int length) o
verride; |
77 void didReceiveData(WebURLLoader*, const char*, int, int encodedDataLength,
int encodedBodyLength) override; | 77 void didReceiveData(WebURLLoader*, const char*, int, int encodedDataLength,
int encodedBodyLength) override; |
78 void didDownloadData(WebURLLoader*, int, int) override; | 78 void didDownloadData(WebURLLoader*, int, int) override; |
79 void didFinishLoading(WebURLLoader*, double finishTime, int64_t encodedDataL
ength) override; | 79 void didFinishLoading(WebURLLoader*, double finishTime, int64_t encodedDataL
ength) override; |
80 void didFail(WebURLLoader*, const WebURLError&) override; | 80 void didFail(WebURLLoader*, const WebURLError&) override; |
81 | 81 |
82 void didFinishLoadingFirstPartInMultipart(); | 82 void didFinishLoadingFirstPartInMultipart(); |
83 | 83 |
84 private: | 84 private: |
85 // Assumes ResourceFetcher and Resource are non-null. | 85 // Assumes ResourceFetcher and Resource are non-null. |
86 ResourceLoader(ResourceFetcher*, Resource*); | 86 ResourceLoader(ResourceFetcher*, Resource*); |
87 | 87 |
| 88 void cancelForRedirectAccessCheckError(const KURL&); |
88 void requestSynchronously(const ResourceRequest&); | 89 void requestSynchronously(const ResourceRequest&); |
89 | 90 |
90 std::unique_ptr<WebURLLoader> m_loader; | 91 std::unique_ptr<WebURLLoader> m_loader; |
91 Member<ResourceFetcher> m_fetcher; | 92 Member<ResourceFetcher> m_fetcher; |
92 Member<Resource> m_resource; | 93 Member<Resource> m_resource; |
93 }; | 94 }; |
94 | 95 |
95 } // namespace blink | 96 } // namespace blink |
96 | 97 |
97 #endif | 98 #endif |
OLD | NEW |