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

Unified Diff: content/browser/appcache/appcache_job.cc

Issue 2902653002: Get main frame and subframe AppCache loads to work. (Closed)
Patch Set: Add comments and helper functions 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_job.cc
diff --git a/content/browser/appcache/appcache_job.cc b/content/browser/appcache/appcache_job.cc
index 27a5897298f9aef2f51c2c5714d95333554a012a..fa8f185892d94306d8a5156860146037658fd665 100644
--- a/content/browser/appcache/appcache_job.cc
+++ b/content/browser/appcache/appcache_job.cc
@@ -23,7 +23,8 @@ std::unique_ptr<AppCacheJob> AppCacheJob::Create(
std::unique_ptr<AppCacheJob> job;
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableNetworkService)) {
- job.reset(new AppCacheURLLoaderJob);
+ job.reset(
+ new AppCacheURLLoaderJob(*(request->GetResourceRequest()), storage));
} else {
job.reset(new AppCacheURLRequestJob(request->GetURLRequest(),
network_delegate, storage, host,
@@ -34,6 +35,26 @@ std::unique_ptr<AppCacheJob> AppCacheJob::Create(
AppCacheJob::~AppCacheJob() {}
+bool AppCacheJob::IsWaiting() const {
+ return delivery_type_ == AWAITING_DELIVERY_ORDERS;
+}
+
+bool AppCacheJob::IsDeliveringAppCacheResponse() const {
+ return delivery_type_ == APPCACHED_DELIVERY;
+}
+
+bool AppCacheJob::IsDeliveringNetworkResponse() const {
+ return delivery_type_ == NETWORK_DELIVERY;
+}
+
+bool AppCacheJob::IsDeliveringErrorResponse() const {
+ return delivery_type_ == ERROR_DELIVERY;
+}
+
+bool AppCacheJob::IsCacheEntryNotFound() const {
+ return cache_entry_not_found_;
+}
+
base::WeakPtr<AppCacheJob> AppCacheJob::GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
@@ -46,6 +67,9 @@ AppCacheURLLoaderJob* AppCacheJob::AsURLLoaderJob() {
return nullptr;
}
-AppCacheJob::AppCacheJob() : weak_factory_(this) {}
+AppCacheJob::AppCacheJob()
+ : cache_entry_not_found_(false),
+ delivery_type_(AWAITING_DELIVERY_ORDERS),
+ weak_factory_(this) {}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698