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

Unified Diff: content/browser/appcache/appcache_url_loader_job.h

Issue 2865613002: Add an abstraction for a job in the AppCacheRequestHandler class. (Closed)
Patch Set: Fix compile failures Created 3 years, 7 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: content/browser/appcache/appcache_url_loader_job.h
diff --git a/content/browser/appcache/appcache_url_loader_job.h b/content/browser/appcache/appcache_url_loader_job.h
new file mode 100644
index 0000000000000000000000000000000000000000..3d526c9b05fb7057ccd68a405db3bca390ba4f5b
--- /dev/null
+++ b/content/browser/appcache/appcache_url_loader_job.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2017 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 CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_JOB_H_
+#define CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_JOB_H_
+
+#include "base/logging.h"
+#include "base/strings/string16.h"
+#include "content/browser/appcache/appcache_job.h"
+#include "content/common/content_export.h"
+
+namespace content {
+
+class AppCacheHost;
+class AppCacheRequest;
+class AppCacheStorage;
+
+// AppCacheJob wrapper for a mojom::URLLoader implementation which returns
+// responses stored in the AppCache.
+class CONTENT_EXPORT AppCacheURLLoaderJob : public AppCacheJob {
+ public:
+ ~AppCacheURLLoaderJob() override;
+
+ // AppCacheJob overrides.
+ void Kill() override;
+ bool IsStarted() const override;
+ bool IsWaiting() const override;
+ bool IsDeliveringAppCacheResponse() const override;
+ bool IsDeliveringNetworkResponse() const override;
+ bool IsDeliveringErrorResponse() const override;
+ bool IsCacheEntryNotFound() const override;
+ void DeliverAppCachedResponse(const GURL& manifest_url,
+ int64_t cache_id,
+ const AppCacheEntry& entry,
+ bool is_fallback) override;
+ void DeliverNetworkResponse() override;
+ void DeliverErrorResponse() override;
+ const GURL& GetURL() const override;
+
+ protected:
+ // AppCacheJob::Create() creates this instance.
+ friend class AppCacheJob;
+
+ AppCacheURLLoaderJob();
+
+ GURL url_;
+
+ DISALLOW_COPY_AND_ASSIGN(AppCacheURLLoaderJob);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_JOB_H_
« no previous file with comments | « content/browser/appcache/appcache_request_handler_unittest.cc ('k') | content/browser/appcache/appcache_url_loader_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698