| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/appcache/appcache.h" | 5 #include "content/browser/appcache/appcache.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 if (handler) | 102 if (handler) |
| 103 return handler; | 103 return handler; |
| 104 | 104 |
| 105 GURL handler_url; | 105 GURL handler_url; |
| 106 const AppCacheEntry* entry = GetEntryAndUrlWithResponseId( | 106 const AppCacheEntry* entry = GetEntryAndUrlWithResponseId( |
| 107 response_id, &handler_url); | 107 response_id, &handler_url); |
| 108 if (!entry || !entry->IsExecutable()) | 108 if (!entry || !entry->IsExecutable()) |
| 109 return NULL; | 109 return NULL; |
| 110 | 110 |
| 111 DCHECK(storage_->service()->handler_factory()); | 111 DCHECK(storage_->service()->handler_factory()); |
| 112 scoped_ptr<AppCacheExecutableHandler> own_ptr = | 112 std::unique_ptr<AppCacheExecutableHandler> own_ptr = |
| 113 storage_->service()->handler_factory()-> | 113 storage_->service()->handler_factory()->CreateHandler(handler_url, |
| 114 CreateHandler(handler_url, handler_source); | 114 handler_source); |
| 115 handler = own_ptr.release(); | 115 handler = own_ptr.release(); |
| 116 if (!handler) | 116 if (!handler) |
| 117 return NULL; | 117 return NULL; |
| 118 executable_handlers_[response_id] = handler; | 118 executable_handlers_[response_id] = handler; |
| 119 return handler; | 119 return handler; |
| 120 } | 120 } |
| 121 | 121 |
| 122 GURL AppCache::GetNamespaceEntryUrl(const AppCacheNamespaceVector& namespaces, | 122 GURL AppCache::GetNamespaceEntryUrl(const AppCacheNamespaceVector& namespaces, |
| 123 const GURL& namespace_url) const { | 123 const GURL& namespace_url) const { |
| 124 size_t count = namespaces.size(); | 124 size_t count = namespaces.size(); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 const GURL& url) { | 322 const GURL& url) { |
| 323 size_t count = namespaces.size(); | 323 size_t count = namespaces.size(); |
| 324 for (size_t i = 0; i < count; ++i) { | 324 for (size_t i = 0; i < count; ++i) { |
| 325 if (namespaces[i].IsMatch(url)) | 325 if (namespaces[i].IsMatch(url)) |
| 326 return &namespaces[i]; | 326 return &namespaces[i]; |
| 327 } | 327 } |
| 328 return NULL; | 328 return NULL; |
| 329 } | 329 } |
| 330 | 330 |
| 331 } // namespace content | 331 } // namespace content |
| OLD | NEW |