OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 WebData dataOut; | 270 WebData dataOut; |
271 | 271 |
272 loader->loadSynchronously(requestIn, responseOut, errorOut, dataOut); | 272 loader->loadSynchronously(requestIn, responseOut, errorOut, dataOut); |
273 | 273 |
274 error = errorOut; | 274 error = errorOut; |
275 data.clear(); | 275 data.clear(); |
276 data.append(dataOut.data(), dataOut.size()); | 276 data.append(dataOut.data(), dataOut.size()); |
277 } | 277 } |
278 | 278 |
279 // static | 279 // static |
| 280 bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame*) |
| 281 { |
| 282 // This method is used to determine if a POST request can be repeated from |
| 283 // cache, but you cannot really know until you actually try to read from the |
| 284 // cache. Even if we checked now, something else could come along and wipe |
| 285 // out the cache entry by the time we fetch it. |
| 286 // |
| 287 // So, we always say yes here, to prevent the FrameLoader from initiating a |
| 288 // reload. Then in FrameLoaderClientImpl::dispatchWillSendRequest, we |
| 289 // fix-up the cache policy of the request to force a load from the cache. |
| 290 // |
| 291 ASSERT(request.httpMethod() == "POST"); |
| 292 return true; |
| 293 } |
| 294 |
| 295 // static |
280 void ResourceHandle::cacheMetadata(const ResourceResponse& response, const Vecto
r<char>& data) | 296 void ResourceHandle::cacheMetadata(const ResourceResponse& response, const Vecto
r<char>& data) |
281 { | 297 { |
282 WebKit::Platform::current()->cacheMetadata(response.url(), response.response
Time(), data.data(), data.size()); | 298 WebKit::Platform::current()->cacheMetadata(response.url(), response.response
Time(), data.data(), data.size()); |
283 } | 299 } |
284 | 300 |
285 } // namespace WebCore | 301 } // namespace WebCore |
OLD | NEW |