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

Side by Side Diff: third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.cpp

Issue 2143483002: Use the single char overload of append() when possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 "modules/cachestorage/InspectorCacheStorageAgent.h" 5 #include "modules/cachestorage/InspectorCacheStorageAgent.h"
6 6
7 #include "platform/heap/Handle.h" 7 #include "platform/heap/Handle.h"
8 #include "platform/inspector_protocol/DispatcherBase.h" 8 #include "platform/inspector_protocol/DispatcherBase.h"
9 #include "platform/inspector_protocol/Values.h" 9 #include "platform/inspector_protocol/Values.h"
10 #include "platform/weborigin/KURL.h" 10 #include "platform/weborigin/KURL.h"
(...skipping 28 matching lines...) Expand all
39 typedef blink::protocol::CacheStorage::Backend::RequestEntriesCallback RequestEn triesCallback; 39 typedef blink::protocol::CacheStorage::Backend::RequestEntriesCallback RequestEn triesCallback;
40 typedef blink::WebServiceWorkerCache::BatchOperation BatchOperation; 40 typedef blink::WebServiceWorkerCache::BatchOperation BatchOperation;
41 41
42 namespace blink { 42 namespace blink {
43 43
44 namespace { 44 namespace {
45 45
46 String buildCacheId(const String& securityOrigin, const String& cacheName) 46 String buildCacheId(const String& securityOrigin, const String& cacheName)
47 { 47 {
48 String id(securityOrigin); 48 String id(securityOrigin);
49 id.append("|"); 49 id.append('|');
50 id.append(cacheName); 50 id.append(cacheName);
51 return id; 51 return id;
52 } 52 }
53 53
54 bool parseCacheId(ErrorString* errorString, const String& id, String* securityOr igin, String* cacheName) 54 bool parseCacheId(ErrorString* errorString, const String& id, String* securityOr igin, String* cacheName)
55 { 55 {
56 size_t pipe = id.find('|'); 56 size_t pipe = id.find('|');
57 if (pipe == WTF::kNotFound) { 57 if (pipe == WTF::kNotFound) {
58 *errorString = "Invalid cache id."; 58 *errorString = "Invalid cache id.";
59 return false; 59 return false;
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 std::unique_ptr<WebServiceWorkerCacheStorage> cache = assertCacheStorageAndN ameForId(errorString, cacheId, &cacheName); 457 std::unique_ptr<WebServiceWorkerCacheStorage> cache = assertCacheStorageAndN ameForId(errorString, cacheId, &cacheName);
458 if (!cache) { 458 if (!cache) {
459 callback->sendFailure(*errorString); 459 callback->sendFailure(*errorString);
460 return; 460 return;
461 } 461 }
462 cache->dispatchOpen(new GetCacheForDeleteEntry(request, cacheName, std::move (callback)), WebString(cacheName)); 462 cache->dispatchOpen(new GetCacheForDeleteEntry(request, cacheName, std::move (callback)), WebString(cacheName));
463 } 463 }
464 464
465 465
466 } // namespace blink 466 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698