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

Unified Diff: webkit/browser/appcache/appcache_request_handler.h

Issue 344493002: Move all remaining appcache-related code to content namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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
Index: webkit/browser/appcache/appcache_request_handler.h
diff --git a/webkit/browser/appcache/appcache_request_handler.h b/webkit/browser/appcache/appcache_request_handler.h
deleted file mode 100644
index fd3d1ad70663ed667512229bced2839805057305..0000000000000000000000000000000000000000
--- a/webkit/browser/appcache/appcache_request_handler.h
+++ /dev/null
@@ -1,152 +0,0 @@
-// Copyright (c) 2011 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.
-
-#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_
-#define WEBKIT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_
-
-#include "base/compiler_specific.h"
-#include "base/supports_user_data.h"
-#include "webkit/browser/appcache/appcache_entry.h"
-#include "webkit/browser/appcache/appcache_host.h"
-#include "webkit/browser/webkit_storage_browser_export.h"
-#include "webkit/common/resource_type.h"
-
-namespace net {
-class NetworkDelegate;
-class URLRequest;
-class URLRequestJob;
-} // namespace net
-
-namespace content {
-class AppCacheRequestHandlerTest;
-}
-
-namespace appcache {
-
-class AppCacheURLRequestJob;
-
-// An instance is created for each net::URLRequest. The instance survives all
-// http transactions involved in the processing of its net::URLRequest, and is
-// given the opportunity to hijack the request along the way. Callers
-// should use AppCacheHost::CreateRequestHandler to manufacture instances
-// that can retrieve resources for a particular host.
-class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheRequestHandler
- : public base::SupportsUserData::Data,
- public AppCacheHost::Observer,
- public AppCacheStorage::Delegate {
- public:
- virtual ~AppCacheRequestHandler();
-
- // These are called on each request intercept opportunity.
- AppCacheURLRequestJob* MaybeLoadResource(
- net::URLRequest* request, net::NetworkDelegate* network_delegate);
- AppCacheURLRequestJob* MaybeLoadFallbackForRedirect(
- net::URLRequest* request,
- net::NetworkDelegate* network_delegate,
- const GURL& location);
- AppCacheURLRequestJob* MaybeLoadFallbackForResponse(
- net::URLRequest* request, net::NetworkDelegate* network_delegate);
-
- void GetExtraResponseInfo(int64* cache_id, GURL* manifest_url);
-
- // Methods to support cross site navigations.
- void PrepareForCrossSiteTransfer(int old_process_id);
- void CompleteCrossSiteTransfer(int new_process_id, int new_host_id);
-
- static bool IsMainResourceType(ResourceType::Type type) {
- return ResourceType::IsFrame(type) ||
- ResourceType::IsSharedWorker(type);
- }
-
- private:
- friend class AppCacheHost;
-
- // Callers should use AppCacheHost::CreateRequestHandler.
- AppCacheRequestHandler(AppCacheHost* host, ResourceType::Type resource_type);
-
- // AppCacheHost::Observer override
- virtual void OnDestructionImminent(AppCacheHost* host) OVERRIDE;
-
- // Helpers to instruct a waiting job with what response to
- // deliver for the request we're handling.
- void DeliverAppCachedResponse(const AppCacheEntry& entry, int64 cache_id,
- int64 group_id, const GURL& manifest_url,
- bool is_fallback,
- const GURL& namespace_entry_url);
- void DeliverNetworkResponse();
- void DeliverErrorResponse();
-
- // Helper to retrieve a pointer to the storage object.
- AppCacheStorage* storage() const;
-
- bool is_main_resource() const {
- return IsMainResourceType(resource_type_);
- }
-
- // Main-resource loading -------------------------------------
- // Frame and SharedWorker main resources are handled here.
-
- void MaybeLoadMainResource(net::URLRequest* request,
- net::NetworkDelegate* network_delegate);
-
- // AppCacheStorage::Delegate methods
- virtual void OnMainResponseFound(
- const GURL& url, const AppCacheEntry& entry,
- const GURL& fallback_url, const AppCacheEntry& fallback_entry,
- int64 cache_id, int64 group_id, const GURL& mainfest_url) OVERRIDE;
-
- // Sub-resource loading -------------------------------------
- // Dedicated worker and all manner of sub-resources are handled here.
-
- void MaybeLoadSubResource(net::URLRequest* request,
- net::NetworkDelegate* network_delegate);
- void ContinueMaybeLoadSubResource();
-
- // AppCacheHost::Observer override
- virtual void OnCacheSelectionComplete(AppCacheHost* host) OVERRIDE;
-
- // Data members -----------------------------------------------
-
- // What host we're servicing a request for.
- AppCacheHost* host_;
-
- // Frame vs subresource vs sharedworker loads are somewhat different.
- ResourceType::Type resource_type_;
-
- // Subresource requests wait until after cache selection completes.
- bool is_waiting_for_cache_selection_;
-
- // Info about the type of response we found for delivery.
- // These are relevant for both main and subresource requests.
- int64 found_group_id_;
- int64 found_cache_id_;
- AppCacheEntry found_entry_;
- AppCacheEntry found_fallback_entry_;
- GURL found_namespace_entry_url_;
- GURL found_manifest_url_;
- bool found_network_namespace_;
-
- // True if a cache entry this handler attempted to return was
- // not found in the disk cache. Once set, the handler will take
- // no action on all subsequent intercept opportunities, so the
- // request and any redirects will be handled by the network library.
- bool cache_entry_not_found_;
-
- // True if this->MaybeLoadResource(...) has been called in the past.
- bool maybe_load_resource_executed_;
-
- // The job we use to deliver a response.
- scoped_refptr<AppCacheURLRequestJob> job_;
-
- // During a cross site navigation, we transfer ownership the AppcacheHost
- // from the old processes structures over to the new structures.
- scoped_ptr<AppCacheHost> host_for_cross_site_transfer_;
-
- friend class content::AppCacheRequestHandlerTest;
- DISALLOW_COPY_AND_ASSIGN(AppCacheRequestHandler);
-};
-
-} // namespace appcache
-
-#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698