Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: webkit/appcache/appcache_request_handler.cc

Issue 192043: AppCacheHost cache selection algorithm (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/appcache/appcache_request_handler.h ('k') | webkit/appcache/appcache_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/appcache/appcache_request_handler.cc
===================================================================
--- webkit/appcache/appcache_request_handler.cc (revision 0)
+++ webkit/appcache/appcache_request_handler.cc (revision 0)
@@ -0,0 +1,63 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "webkit/appcache/appcache_request_handler.h"
+
+#include "net/url_request/url_request.h"
+#include "net/url_request/url_request_job.h"
+#include "webkit/appcache/appcache.h"
+
+namespace appcache {
+
+// AppCacheRequestHandler -----------------------------------------------------
+
+static bool IsHttpOrHttpsGetOrEquivalent(URLRequest* request) {
+ return false; // TODO(michaeln): write me
+}
+
+AppCacheRequestHandler::AppCacheRequestHandler(AppCacheHost* host)
+ : is_main_request_(true), cache_id_(kNoCacheId),
+ host_(host->AsWeakPtr()), service_(host->service()) {
+}
+
+AppCacheRequestHandler::AppCacheRequestHandler(AppCache* cache)
+ : is_main_request_(false), cache_id_(kNoCacheId),
+ cache_(cache), service_(cache->service()) {
+}
+
+void AppCacheRequestHandler::GetExtraResponseInfo(
+ int64* cache_id, GURL* manifest_url) {
+ // TODO(michaeln): If this is a main request and it was retrieved from
+ // an appcache, ensure that appcache survives the frame navigation. The
+ // AppCacheHost should hold reference to that cache to prevent it from
+ // being dropped from the in-memory collection of AppCaches. When cache
+ // selection occurs, that extra reference should be dropped. Perhaps
+ // maybe: if (is_main) host->LoadCacheOfMainResource(cache_id);
+}
+
+URLRequestJob* AppCacheRequestHandler::MaybeLoadResource(URLRequest* request) {
+ if (!IsHttpOrHttpsGetOrEquivalent(request))
+ return NULL;
+ // TODO(michaeln): write me
+ return NULL;
+}
+
+URLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForRedirect(
+ URLRequest* request, const GURL& location) {
+ if (!IsHttpOrHttpsGetOrEquivalent(request))
+ return NULL;
+ // TODO(michaeln): write me
+ return NULL;
+}
+
+URLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForResponse(
+ URLRequest* request) {
+ if (!IsHttpOrHttpsGetOrEquivalent(request))
+ return NULL;
+ // TODO(michaeln): write me
+ return NULL;
+}
+
+} // namespace appcache
+
Property changes on: webkit\appcache\appcache_request_handler.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « webkit/appcache/appcache_request_handler.h ('k') | webkit/appcache/appcache_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698