| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/cache_storage/cache_storage_dispatcher_host.h" | 5 #include "content/browser/cache_storage/cache_storage_dispatcher_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 case CACHE_STORAGE_ERROR_CACHE_NAME_NOT_FOUND: | 54 case CACHE_STORAGE_ERROR_CACHE_NAME_NOT_FOUND: |
| 55 return blink::WebServiceWorkerCacheErrorCacheNameNotFound; | 55 return blink::WebServiceWorkerCacheErrorCacheNameNotFound; |
| 56 case CACHE_STORAGE_ERROR_QUERY_TOO_LARGE: | 56 case CACHE_STORAGE_ERROR_QUERY_TOO_LARGE: |
| 57 return blink::WebServiceWorkerCacheErrorTooLarge; | 57 return blink::WebServiceWorkerCacheErrorTooLarge; |
| 58 } | 58 } |
| 59 NOTREACHED(); | 59 NOTREACHED(); |
| 60 return blink::WebServiceWorkerCacheErrorNotImplemented; | 60 return blink::WebServiceWorkerCacheErrorNotImplemented; |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool OriginCanAccessCacheStorage(const url::Origin& origin) { | 63 bool OriginCanAccessCacheStorage(const url::Origin& origin) { |
| 64 return !origin.unique() && IsOriginSecure(origin.GetURL()); | 64 return !origin.opaque() && IsOriginSecure(origin.GetURL()); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void StopPreservingCache( | 67 void StopPreservingCache( |
| 68 std::unique_ptr<CacheStorageCacheHandle> cache_handle) {} | 68 std::unique_ptr<CacheStorageCacheHandle> cache_handle) {} |
| 69 | 69 |
| 70 } // namespace | 70 } // namespace |
| 71 | 71 |
| 72 CacheStorageDispatcherHost::CacheStorageDispatcherHost() | 72 CacheStorageDispatcherHost::CacheStorageDispatcherHost() |
| 73 : BrowserMessageFilter(kFilteredMessageClasses, | 73 : BrowserMessageFilter(kFilteredMessageClasses, |
| 74 arraysize(kFilteredMessageClasses)) {} | 74 arraysize(kFilteredMessageClasses)) {} |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 UUIDToBlobDataHandleList::iterator it = blob_handle_store_.find(uuid); | 531 UUIDToBlobDataHandleList::iterator it = blob_handle_store_.find(uuid); |
| 532 if (it == blob_handle_store_.end()) | 532 if (it == blob_handle_store_.end()) |
| 533 return; | 533 return; |
| 534 DCHECK(!it->second.empty()); | 534 DCHECK(!it->second.empty()); |
| 535 it->second.pop_front(); | 535 it->second.pop_front(); |
| 536 if (it->second.empty()) | 536 if (it->second.empty()) |
| 537 blob_handle_store_.erase(it); | 537 blob_handle_store_.erase(it); |
| 538 } | 538 } |
| 539 | 539 |
| 540 } // namespace content | 540 } // namespace content |
| OLD | NEW |