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

Side by Side Diff: third_party/WebKit/Source/platform/loader/fetch/Resource.cpp

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: Created 3 years, 10 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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
7 rights reserved. 7 rights reserved.
8 8
9 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 // |m_taskHandle| is destroyed on the dtor of this ResourceCallback. 272 // |m_taskHandle| is destroyed on the dtor of this ResourceCallback.
273 m_taskHandle = 273 m_taskHandle =
274 Platform::current() 274 Platform::current()
275 ->currentThread() 275 ->currentThread()
276 ->scheduler() 276 ->scheduler()
277 ->loadingTaskRunner() 277 ->loadingTaskRunner()
278 ->postCancellableTask( 278 ->postCancellableTask(
279 BLINK_FROM_HERE, 279 BLINK_FROM_HERE,
280 WTF::bind(&ResourceCallback::runTask, WTF::unretained(this))); 280 WTF::bind(&ResourceCallback::runTask, WTF::unretained(this)));
281 } 281 }
282 m_resourcesWithPendingClients.add(resource); 282 m_resourcesWithPendingClients.insert(resource);
283 } 283 }
284 284
285 void Resource::ResourceCallback::cancel(Resource* resource) { 285 void Resource::ResourceCallback::cancel(Resource* resource) {
286 m_resourcesWithPendingClients.remove(resource); 286 m_resourcesWithPendingClients.remove(resource);
287 if (m_taskHandle.isActive() && m_resourcesWithPendingClients.isEmpty()) 287 if (m_taskHandle.isActive() && m_resourcesWithPendingClients.isEmpty())
288 m_taskHandle.cancel(); 288 m_taskHandle.cancel();
289 } 289 }
290 290
291 bool Resource::ResourceCallback::isScheduled(Resource* resource) const { 291 bool Resource::ResourceCallback::isScheduled(Resource* resource) const {
292 return m_resourcesWithPendingClients.contains(resource); 292 return m_resourcesWithPendingClients.contains(resource);
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 case Resource::Media: 1109 case Resource::Media:
1110 case Resource::Manifest: 1110 case Resource::Manifest:
1111 case Resource::Mock: 1111 case Resource::Mock:
1112 return false; 1112 return false;
1113 } 1113 }
1114 NOTREACHED(); 1114 NOTREACHED();
1115 return false; 1115 return false;
1116 } 1116 }
1117 1117
1118 } // namespace blink 1118 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698