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

Side by Side Diff: content/browser/service_worker/service_worker_database.cc

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 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 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_database.h" 5 #include "content/browser/service_worker/service_worker_database.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 ServiceWorkerEnv() 115 ServiceWorkerEnv()
116 : ChromiumEnv("LevelDBEnv.ServiceWorker", false /* make_backup */) {} 116 : ChromiumEnv("LevelDBEnv.ServiceWorker", false /* make_backup */) {}
117 }; 117 };
118 118
119 base::LazyInstance<ServiceWorkerEnv>::Leaky g_service_worker_env = 119 base::LazyInstance<ServiceWorkerEnv>::Leaky g_service_worker_env =
120 LAZY_INSTANCE_INITIALIZER; 120 LAZY_INSTANCE_INITIALIZER;
121 121
122 bool RemovePrefix(const std::string& str, 122 bool RemovePrefix(const std::string& str,
123 const std::string& prefix, 123 const std::string& prefix,
124 std::string* out) { 124 std::string* out) {
125 if (!base::StartsWithASCII(str, prefix, true)) 125 if (!base::StartsWith(str, prefix, base::CompareCase::SENSITIVE))
126 return false; 126 return false;
127 if (out) 127 if (out)
128 *out = str.substr(prefix.size()); 128 *out = str.substr(prefix.size());
129 return true; 129 return true;
130 } 130 }
131 131
132 std::string CreateRegistrationKeyPrefix(const GURL& origin) { 132 std::string CreateRegistrationKeyPrefix(const GURL& origin) {
133 return base::StringPrintf("%s%s%c", kRegKeyPrefix, 133 return base::StringPrintf("%s%s%c", kRegKeyPrefix,
134 origin.GetOrigin().spec().c_str(), kKeySeparator); 134 origin.GetOrigin().spec().c_str(), kKeySeparator);
135 } 135 }
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after
1598 if (status != STATUS_OK) 1598 if (status != STATUS_OK)
1599 Disable(from_here, status); 1599 Disable(from_here, status);
1600 ServiceWorkerMetrics::CountWriteDatabaseResult(status); 1600 ServiceWorkerMetrics::CountWriteDatabaseResult(status);
1601 } 1601 }
1602 1602
1603 bool ServiceWorkerDatabase::IsDatabaseInMemory() const { 1603 bool ServiceWorkerDatabase::IsDatabaseInMemory() const {
1604 return path_.empty(); 1604 return path_.empty();
1605 } 1605 }
1606 1606
1607 } // namespace content 1607 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | content/browser/service_worker/service_worker_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698