diff --git a/chromium/content/browser/appcache/appcache_response.cc b/chromium/content/browser/appcache/appcache_response.cc
index dfa205d..cf2da20 100644
--- a/chromium/content/browser/appcache/appcache_response.cc
+++ b/chromium/content/browser/appcache/appcache_response.cc
@@ -331,7 +331,7 @@ void AppCacheResponseWriter::WriteInfo(
   DCHECK(info_buf->http_info.get());
   DCHECK(!buffer_.get());
   DCHECK(!info_buffer_.get());
-  DCHECK(info_buf->http_info->headers.get());
+  //DCHECK(info_buf->http_info->headers.get());
 
   info_buffer_ = info_buf;
   callback_ = callback;  // cleared on completion
diff --git a/chromium/content/browser/service_worker/service_worker_storage.cc b/chromium/content/browser/service_worker/service_worker_storage.cc
index 7fe9008..fc2db9d 100644
--- a/chromium/content/browser/service_worker/service_worker_storage.cc
+++ b/chromium/content/browser/service_worker/service_worker_storage.cc
@@ -1151,7 +1151,9 @@ void ServiceWorkerStorage::DidDeleteRegistration(
         storage::QuotaClient::kServiceWorker,
         params.origin,
         storage::StorageType::kStorageTypeTemporary,
-        -deleted_version.resources_total_size_bytes);
+        deleted_version.resources_total_size_bytes >= 0
+                ? deleted_version.resources_total_size_bytes
+                : -deleted_version.resources_total_size_bytes);
   }
   if (origin_state == OriginState::DELETE_FROM_ALL)
     registered_origins_.erase(params.origin);
diff --git a/chromium/content/browser/service_worker/service_worker_write_to_cache_job.cc b/chromium/content/browser/service_worker/service_worker_write_to_cache_job.cc
index 357ee19..ee9e4da 100644
--- a/chromium/content/browser/service_worker/service_worker_write_to_cache_job.cc
+++ b/chromium/content/browser/service_worker/service_worker_write_to_cache_job.cc
@@ -125,13 +125,13 @@ net::LoadState ServiceWorkerWriteToCacheJob::GetLoadState() const {
 }
 
 bool ServiceWorkerWriteToCacheJob::GetCharset(std::string* charset) {
-  if (!http_info())
+  if (!http_info() || !http_info()->headers)
     return false;
   return http_info()->headers->GetCharset(charset);
 }
 
 bool ServiceWorkerWriteToCacheJob::GetMimeType(std::string* mime_type) const {
-  if (!http_info())
+  if (!http_info() || !http_info()->headers)
     return false;
   return http_info()->headers->GetMimeType(mime_type);
 }
@@ -144,7 +144,7 @@ void ServiceWorkerWriteToCacheJob::GetResponseInfo(
 }
 
 int ServiceWorkerWriteToCacheJob::GetResponseCode() const {
-  if (!http_info())
+  if (!http_info() || !http_info()->headers)
     return -1;
   return http_info()->headers->response_code();
 }
@@ -287,7 +287,9 @@ void ServiceWorkerWriteToCacheJob::OnResponseStarted(
     NotifyStartErrorHelper(request->status(), kFetchScriptError);
     return;
   }
-  if (request->GetResponseCode() / 100 != 2) {
+
+  if (request->url().SchemeIsHTTPOrHTTPS()
+      && (request->GetResponseCode() / 100 != 2)) {
     std::string error_message =
         base::StringPrintf(kBadHTTPResponseError, request->GetResponseCode());
     NotifyStartErrorHelper(net::URLRequestStatus(net::URLRequestStatus::FAILED,
@@ -297,6 +299,7 @@ void ServiceWorkerWriteToCacheJob::OnResponseStarted(
     // response to our consumer, just don't cache it?
     return;
   }
+
   // OnSSLCertificateError is not called when the HTTPS connection is reused.
   // So we check cert_status here.
   if (net::IsCertStatusError(request->ssl_info().cert_status)) {
@@ -401,7 +404,8 @@ bool ServiceWorkerWriteToCacheJob::CheckPathRestriction(
     net::URLRequest* request) {
   std::string service_worker_allowed;
   const net::HttpResponseHeaders* headers = request->response_headers();
-  bool has_header = headers->EnumerateHeader(nullptr, kServiceWorkerAllowed,
+  bool has_header = headers
+                 && headers->EnumerateHeader(nullptr, kServiceWorkerAllowed,
                                              &service_worker_allowed);
 
   std::string error_message;
diff --git a/chromium/net/http/http_response_info.cc b/chromium/net/http/http_response_info.cc
index 8c9127b..431eb8d 100644
--- a/chromium/net/http/http_response_info.cc
+++ b/chromium/net/http/http_response_info.cc
@@ -361,7 +361,8 @@ void HttpResponseInfo::Persist(base::Pickle* pickle,
                       HttpResponseHeaders::PERSIST_SANS_SECURITY_STATE;
   }
 
-  headers->Persist(pickle, persist_options);
+  if (headers.get())
+    headers->Persist(pickle, persist_options);
 
   if (ssl_info.is_valid()) {
     ssl_info.cert->Persist(pickle);
