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

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

Issue 2902653002: Get main frame and subframe AppCache loads to work. (Closed)
Patch Set: Address review comments Created 3 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
« no previous file with comments | « content/browser/appcache/appcache_job.h ('k') | content/browser/appcache/appcache_request_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/appcache/appcache_job.cc
diff --git a/content/browser/appcache/appcache_job.cc b/content/browser/appcache/appcache_job.cc
index 271553f6bfdc3c66adc1a330c198a8a5d8be9cdd..5bd29cc8c421ed7a2dc8d97d2833ccfca6f0373b 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,
@@ -36,6 +37,26 @@ AppCacheJob::~AppCacheJob() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}
+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();
}
@@ -48,6 +69,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
« no previous file with comments | « content/browser/appcache/appcache_job.h ('k') | content/browser/appcache/appcache_request_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698