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

Side by Side Diff: third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp

Issue 2614833005: Migrate WTF::Vector::append() to ::push_back() [part 10 of N] (Closed)
Patch Set: Created 3 years, 11 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 const String& errorURL, 199 const String& errorURL,
200 int errorStatus, 200 int errorStatus,
201 const String& errorMessage) { 201 const String& errorMessage) {
202 if (id != kProgressEvent) { 202 if (id != kProgressEvent) {
203 InspectorInstrumentation::updateApplicationCacheStatus( 203 InspectorInstrumentation::updateApplicationCacheStatus(
204 m_documentLoader->frame()); 204 m_documentLoader->frame());
205 } 205 }
206 206
207 if (m_defersEvents) { 207 if (m_defersEvents) {
208 // Event dispatching is deferred until document.onload has fired. 208 // Event dispatching is deferred until document.onload has fired.
209 m_deferredEvents.append(DeferredEvent(id, progressTotal, progressDone, 209 m_deferredEvents.push_back(DeferredEvent(id, progressTotal, progressDone,
210 errorReason, errorURL, errorStatus, 210 errorReason, errorURL, errorStatus,
211 errorMessage)); 211 errorMessage));
212 return; 212 return;
213 } 213 }
214 dispatchDOMEvent(id, progressTotal, progressDone, errorReason, errorURL, 214 dispatchDOMEvent(id, progressTotal, progressDone, errorReason, errorURL,
215 errorStatus, errorMessage); 215 errorStatus, errorMessage);
216 } 216 }
217 217
218 ApplicationCacheHost::CacheInfo ApplicationCacheHost::applicationCacheInfo() { 218 ApplicationCacheHost::CacheInfo ApplicationCacheHost::applicationCacheInfo() {
219 if (!m_host) 219 if (!m_host)
220 return CacheInfo(KURL(), 0, 0, 0); 220 return CacheInfo(KURL(), 0, 0, 0);
221 221
222 WebApplicationCacheHost::CacheInfo webInfo; 222 WebApplicationCacheHost::CacheInfo webInfo;
223 m_host->getAssociatedCacheInfo(&webInfo); 223 m_host->getAssociatedCacheInfo(&webInfo);
224 return CacheInfo(webInfo.manifestURL, webInfo.creationTime, 224 return CacheInfo(webInfo.manifestURL, webInfo.creationTime,
225 webInfo.updateTime, webInfo.totalSize); 225 webInfo.updateTime, webInfo.totalSize);
226 } 226 }
227 227
228 void ApplicationCacheHost::fillResourceList(ResourceInfoList* resources) { 228 void ApplicationCacheHost::fillResourceList(ResourceInfoList* resources) {
229 if (!m_host) 229 if (!m_host)
230 return; 230 return;
231 231
232 WebVector<WebApplicationCacheHost::ResourceInfo> webResources; 232 WebVector<WebApplicationCacheHost::ResourceInfo> webResources;
233 m_host->getResourceList(&webResources); 233 m_host->getResourceList(&webResources);
234 for (size_t i = 0; i < webResources.size(); ++i) { 234 for (size_t i = 0; i < webResources.size(); ++i) {
235 resources->append( 235 resources->push_back(
236 ResourceInfo(webResources[i].url, webResources[i].isMaster, 236 ResourceInfo(webResources[i].url, webResources[i].isMaster,
237 webResources[i].isManifest, webResources[i].isFallback, 237 webResources[i].isManifest, webResources[i].isFallback,
238 webResources[i].isForeign, webResources[i].isExplicit, 238 webResources[i].isForeign, webResources[i].isExplicit,
239 webResources[i].size)); 239 webResources[i].size));
240 } 240 }
241 } 241 }
242 242
243 void ApplicationCacheHost::stopDeferringEvents() { 243 void ApplicationCacheHost::stopDeferringEvents() {
244 for (unsigned i = 0; i < m_deferredEvents.size(); ++i) { 244 for (unsigned i = 0; i < m_deferredEvents.size(); ++i) {
245 const DeferredEvent& deferred = m_deferredEvents[i]; 245 const DeferredEvent& deferred = m_deferredEvents[i];
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 notifyApplicationCache(kErrorEvent, 0, 0, reason, url.string(), status, 336 notifyApplicationCache(kErrorEvent, 0, 0, reason, url.string(), status,
337 message); 337 message);
338 } 338 }
339 339
340 DEFINE_TRACE(ApplicationCacheHost) { 340 DEFINE_TRACE(ApplicationCacheHost) {
341 visitor->trace(m_domApplicationCache); 341 visitor->trace(m_domApplicationCache);
342 visitor->trace(m_documentLoader); 342 visitor->trace(m_documentLoader);
343 } 343 }
344 344
345 } // namespace blink 345 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698