OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "webkit/appcache/appcache_request_handler.h" |
| 6 |
| 7 #include "net/url_request/url_request.h" |
| 8 #include "net/url_request/url_request_job.h" |
| 9 #include "webkit/appcache/appcache.h" |
| 10 |
| 11 namespace appcache { |
| 12 |
| 13 // AppCacheRequestHandler ----------------------------------------------------- |
| 14 |
| 15 static bool IsHttpOrHttpsGetOrEquivalent(URLRequest* request) { |
| 16 return false; // TODO(michaeln): write me |
| 17 } |
| 18 |
| 19 AppCacheRequestHandler::AppCacheRequestHandler(AppCacheHost* host) |
| 20 : is_main_request_(true), cache_id_(kNoCacheId), |
| 21 host_(host->AsWeakPtr()), service_(host->service()) { |
| 22 } |
| 23 |
| 24 AppCacheRequestHandler::AppCacheRequestHandler(AppCache* cache) |
| 25 : is_main_request_(false), cache_id_(kNoCacheId), |
| 26 cache_(cache), service_(cache->service()) { |
| 27 } |
| 28 |
| 29 void AppCacheRequestHandler::GetExtraResponseInfo( |
| 30 int64* cache_id, GURL* manifest_url) { |
| 31 // TODO(michaeln): If this is a main request and it was retrieved from |
| 32 // an appcache, ensure that appcache survives the frame navigation. The |
| 33 // AppCacheHost should hold reference to that cache to prevent it from |
| 34 // being dropped from the in-memory collection of AppCaches. When cache |
| 35 // selection occurs, that extra reference should be dropped. Perhaps |
| 36 // maybe: if (is_main) host->LoadCacheOfMainResource(cache_id); |
| 37 } |
| 38 |
| 39 URLRequestJob* AppCacheRequestHandler::MaybeLoadResource(URLRequest* request) { |
| 40 if (!IsHttpOrHttpsGetOrEquivalent(request)) |
| 41 return NULL; |
| 42 // TODO(michaeln): write me |
| 43 return NULL; |
| 44 } |
| 45 |
| 46 URLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForRedirect( |
| 47 URLRequest* request, const GURL& location) { |
| 48 if (!IsHttpOrHttpsGetOrEquivalent(request)) |
| 49 return NULL; |
| 50 // TODO(michaeln): write me |
| 51 return NULL; |
| 52 } |
| 53 |
| 54 URLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForResponse( |
| 55 URLRequest* request) { |
| 56 if (!IsHttpOrHttpsGetOrEquivalent(request)) |
| 57 return NULL; |
| 58 // TODO(michaeln): write me |
| 59 return NULL; |
| 60 } |
| 61 |
| 62 } // namespace appcache |
| 63 |
OLD | NEW |