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

Side by Side Diff: Source/modules/filesystem/DOMFileSystemBase.cpp

Issue 482753002: Use StringBuilder::appendLiteral() / StringBuilder::append(char) when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/filesystem/DOMFileSystem.cpp ('k') | Source/modules/websockets/DOMWebSocket.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 return createFileSystemURL(entry->fullPath()); 132 return createFileSystemURL(entry->fullPath());
133 } 133 }
134 134
135 KURL DOMFileSystemBase::createFileSystemURL(const String& fullPath) const 135 KURL DOMFileSystemBase::createFileSystemURL(const String& fullPath) const
136 { 136 {
137 ASSERT(DOMFilePath::isAbsolute(fullPath)); 137 ASSERT(DOMFilePath::isAbsolute(fullPath));
138 138
139 if (type() == FileSystemTypeExternal) { 139 if (type() == FileSystemTypeExternal) {
140 // For external filesystem originString could be different from what we have in m_filesystemRootURL. 140 // For external filesystem originString could be different from what we have in m_filesystemRootURL.
141 StringBuilder result; 141 StringBuilder result;
142 result.append("filesystem:"); 142 result.appendLiteral("filesystem:");
143 result.append(securityOrigin()->toString()); 143 result.append(securityOrigin()->toString());
144 result.append("/"); 144 result.append('/');
145 result.append(externalPathPrefix); 145 result.append(externalPathPrefix);
146 result.append(m_filesystemRootURL.path()); 146 result.append(m_filesystemRootURL.path());
147 // Remove the extra leading slash. 147 // Remove the extra leading slash.
148 result.append(encodeWithURLEscapeSequences(fullPath.substring(1))); 148 result.append(encodeWithURLEscapeSequences(fullPath.substring(1)));
149 return KURL(ParsedURLString, result.toString()); 149 return KURL(ParsedURLString, result.toString());
150 } 150 }
151 151
152 // For regular types we can just append the entry's fullPath to the m_filesy stemRootURL that should look like 'filesystem:<origin>/<typePrefix>'. 152 // For regular types we can just append the entry's fullPath to the m_filesy stemRootURL that should look like 'filesystem:<origin>/<typePrefix>'.
153 ASSERT(!m_filesystemRootURL.isEmpty()); 153 ASSERT(!m_filesystemRootURL.isEmpty());
154 KURL url = m_filesystemRootURL; 154 KURL url = m_filesystemRootURL;
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 } 380 }
381 381
382 bool DOMFileSystemBase::waitForAdditionalResult(int callbacksId) 382 bool DOMFileSystemBase::waitForAdditionalResult(int callbacksId)
383 { 383 {
384 if (!fileSystem()) 384 if (!fileSystem())
385 return false; 385 return false;
386 return fileSystem()->waitForAdditionalResult(callbacksId); 386 return fileSystem()->waitForAdditionalResult(callbacksId);
387 } 387 }
388 388
389 } // namespace blink 389 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/filesystem/DOMFileSystem.cpp ('k') | Source/modules/websockets/DOMWebSocket.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698