| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/service_worker/service_worker_cache_storage.h" | 5 #include "content/browser/service_worker/service_worker_cache_storage.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/memory_mapped_file.h" | 10 #include "base/files/memory_mapped_file.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/sha1.h" | 12 #include "base/sha1.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "content/browser/service_worker/service_worker_cache.h" | 16 #include "content/browser/service_worker/service_worker_cache.h" |
| 17 #include "content/browser/service_worker/service_worker_cache.pb.h" | 17 #include "content/browser/service_worker/service_worker_cache.pb.h" |
| 18 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 19 #include "net/base/directory_lister.h" | 19 #include "net/base/directory_lister.h" |
| 20 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
| 21 #include "webkit/browser/blob/blob_storage_context.h" | 21 #include "storage/browser/blob/blob_storage_context.h" |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 | 24 |
| 25 // static | 25 // static |
| 26 const int ServiceWorkerCacheStorage::kInvalidCacheID = -1; | 26 const int ServiceWorkerCacheStorage::kInvalidCacheID = -1; |
| 27 | 27 |
| 28 // The meta information related to each ServiceWorkerCache that the | 28 // The meta information related to each ServiceWorkerCache that the |
| 29 // ServiceWorkerCacheManager needs to keep track of. | 29 // ServiceWorkerCacheManager needs to keep track of. |
| 30 // TODO(jkarlin): Add reference counting so that the deletion of javascript | 30 // TODO(jkarlin): Add reference counting so that the deletion of javascript |
| 31 // objects can delete the ServiceWorkerCache. | 31 // objects can delete the ServiceWorkerCache. |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 NameMap::const_iterator name_iter = name_map_.find(cache_name); | 704 NameMap::const_iterator name_iter = name_map_.find(cache_name); |
| 705 if (name_iter == name_map_.end()) | 705 if (name_iter == name_map_.end()) |
| 706 return NULL; | 706 return NULL; |
| 707 | 707 |
| 708 CacheMap::const_iterator map_iter = cache_map_.find(name_iter->second); | 708 CacheMap::const_iterator map_iter = cache_map_.find(name_iter->second); |
| 709 DCHECK(map_iter != cache_map_.end()); | 709 DCHECK(map_iter != cache_map_.end()); |
| 710 return map_iter->second; | 710 return map_iter->second; |
| 711 } | 711 } |
| 712 | 712 |
| 713 } // namespace content | 713 } // namespace content |
| OLD | NEW |