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

Side by Side Diff: Source/core/fetch/ResourceLoaderSet.cpp

Issue 645513003: Use C++11 range-based loop in core/fetch (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: mike's comments Created 6 years, 2 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 void ResourceLoaderSet::trace(Visitor* visitor) 43 void ResourceLoaderSet::trace(Visitor* visitor)
44 { 44 {
45 #if ENABLE(OILPAN) 45 #if ENABLE(OILPAN)
46 visitor->trace(m_set); 46 visitor->trace(m_set);
47 #endif 47 #endif
48 } 48 }
49 49
50 void ResourceLoaderSet::cancelAll() 50 void ResourceLoaderSet::cancelAll()
51 { 51 {
52 WillBeHeapVector<RefPtrWillBeMember<ResourceLoader> > loadersCopy; 52 WillBeHeapVector<RefPtrWillBeMember<ResourceLoader>> loadersCopy;
53 copyToVector(m_set, loadersCopy); 53 copyToVector(m_set, loadersCopy);
54 size_t size = loadersCopy.size(); 54 for (const auto& loader : loadersCopy)
55 for (size_t i = 0; i < size; ++i) 55 loader->cancel();
56 loadersCopy[i]->cancel();
57 } 56 }
58 57
59 void ResourceLoaderSet::setAllDefersLoading(bool defers) 58 void ResourceLoaderSet::setAllDefersLoading(bool defers)
60 { 59 {
61 WillBeHeapVector<RefPtrWillBeMember<ResourceLoader> > loadersCopy; 60 WillBeHeapVector<RefPtrWillBeMember<ResourceLoader>> loadersCopy;
62 copyToVector(m_set, loadersCopy); 61 copyToVector(m_set, loadersCopy);
63 size_t size = loadersCopy.size(); 62 for (const auto& loader : loadersCopy)
64 for (size_t i = 0; i < size; ++i) 63 loader->setDefersLoading(defers);
65 loadersCopy[i]->setDefersLoading(defers);
66 } 64 }
67 65
68 } 66 }
OLDNEW
« Source/core/fetch/ImageResource.cpp ('K') | « Source/core/fetch/ResourceLoaderSet.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698