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

Side by Side Diff: Source/core/inspector/InspectorApplicationCacheAgent.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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 for (int i = 0; it != end; ++it, i++) 174 for (int i = 0; it != end; ++it, i++)
175 resources->addItem(buildObjectForApplicationCacheResource(*it)); 175 resources->addItem(buildObjectForApplicationCacheResource(*it));
176 176
177 return resources; 177 return resources;
178 } 178 }
179 179
180 PassRefPtr<TypeBuilder::ApplicationCache::ApplicationCacheResource> InspectorApp licationCacheAgent::buildObjectForApplicationCacheResource(const ApplicationCach eHost::ResourceInfo& resourceInfo) 180 PassRefPtr<TypeBuilder::ApplicationCache::ApplicationCacheResource> InspectorApp licationCacheAgent::buildObjectForApplicationCacheResource(const ApplicationCach eHost::ResourceInfo& resourceInfo)
181 { 181 {
182 StringBuilder builder; 182 StringBuilder builder;
183 if (resourceInfo.m_isMaster) 183 if (resourceInfo.m_isMaster)
184 builder.append("Master "); 184 builder.appendLiteral("Master ");
185 185
186 if (resourceInfo.m_isManifest) 186 if (resourceInfo.m_isManifest)
187 builder.append("Manifest "); 187 builder.appendLiteral("Manifest ");
188 188
189 if (resourceInfo.m_isFallback) 189 if (resourceInfo.m_isFallback)
190 builder.append("Fallback "); 190 builder.appendLiteral("Fallback ");
191 191
192 if (resourceInfo.m_isForeign) 192 if (resourceInfo.m_isForeign)
193 builder.append("Foreign "); 193 builder.appendLiteral("Foreign ");
194 194
195 if (resourceInfo.m_isExplicit) 195 if (resourceInfo.m_isExplicit)
196 builder.append("Explicit "); 196 builder.appendLiteral("Explicit ");
197 197
198 RefPtr<TypeBuilder::ApplicationCache::ApplicationCacheResource> value = Type Builder::ApplicationCache::ApplicationCacheResource::create() 198 RefPtr<TypeBuilder::ApplicationCache::ApplicationCacheResource> value = Type Builder::ApplicationCache::ApplicationCacheResource::create()
199 .setUrl(resourceInfo.m_resource.string()) 199 .setUrl(resourceInfo.m_resource.string())
200 .setSize(static_cast<int>(resourceInfo.m_size)) 200 .setSize(static_cast<int>(resourceInfo.m_size))
201 .setType(builder.toString()); 201 .setType(builder.toString());
202 return value; 202 return value;
203 } 203 }
204 204
205 void InspectorApplicationCacheAgent::trace(Visitor* visitor) 205 void InspectorApplicationCacheAgent::trace(Visitor* visitor)
206 { 206 {
207 visitor->trace(m_pageAgent); 207 visitor->trace(m_pageAgent);
208 InspectorBaseAgent::trace(visitor); 208 InspectorBaseAgent::trace(visitor);
209 } 209 }
210 210
211 } // namespace blink 211 } // namespace blink
212 212
OLDNEW
« no previous file with comments | « Source/core/inspector/ContentSearchUtils.cpp ('k') | Source/core/inspector/InspectorInspectorAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698