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

Side by Side Diff: content/browser/appcache/appcache.cc

Issue 548373002: Rename AppCache's Manifest to AppCacheManifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
OLDNEW
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 <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 return GURL(); 126 return GURL();
127 } 127 }
128 128
129 namespace { 129 namespace {
130 bool SortNamespacesByLength( 130 bool SortNamespacesByLength(
131 const AppCacheNamespace& lhs, const AppCacheNamespace& rhs) { 131 const AppCacheNamespace& lhs, const AppCacheNamespace& rhs) {
132 return lhs.namespace_url.spec().length() > rhs.namespace_url.spec().length(); 132 return lhs.namespace_url.spec().length() > rhs.namespace_url.spec().length();
133 } 133 }
134 } 134 }
135 135
136 void AppCache::InitializeWithManifest(Manifest* manifest) { 136 void AppCache::InitializeWithManifest(AppCacheManifest* manifest) {
137 DCHECK(manifest); 137 DCHECK(manifest);
138 intercept_namespaces_.swap(manifest->intercept_namespaces); 138 intercept_namespaces_.swap(manifest->intercept_namespaces);
139 fallback_namespaces_.swap(manifest->fallback_namespaces); 139 fallback_namespaces_.swap(manifest->fallback_namespaces);
140 online_whitelist_namespaces_.swap(manifest->online_whitelist_namespaces); 140 online_whitelist_namespaces_.swap(manifest->online_whitelist_namespaces);
141 online_whitelist_all_ = manifest->online_whitelist_all; 141 online_whitelist_all_ = manifest->online_whitelist_all;
142 142
143 // Sort the namespaces by url string length, longest to shortest, 143 // Sort the namespaces by url string length, longest to shortest,
144 // since longer matches trump when matching a url to a namespace. 144 // since longer matches trump when matching a url to a namespace.
145 std::sort(intercept_namespaces_.begin(), intercept_namespaces_.end(), 145 std::sort(intercept_namespaces_.begin(), intercept_namespaces_.end(),
146 SortNamespacesByLength); 146 SortNamespacesByLength);
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 const GURL& url) { 318 const GURL& url) {
319 size_t count = namespaces.size(); 319 size_t count = namespaces.size();
320 for (size_t i = 0; i < count; ++i) { 320 for (size_t i = 0; i < count; ++i) {
321 if (namespaces[i].IsMatch(url)) 321 if (namespaces[i].IsMatch(url))
322 return &namespaces[i]; 322 return &namespaces[i];
323 } 323 }
324 return NULL; 324 return NULL;
325 } 325 }
326 326
327 } // namespace content 327 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/appcache/appcache.h ('k') | content/browser/appcache/appcache_manifest_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698