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

Side by Side Diff: third_party/WebKit/Source/wtf/Vector.h

Issue 1652953002: Make copyToVector() robust against conservative GCs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unnecessary 'template' use Created 4 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
« no previous file with comments | « third_party/WebKit/Source/wtf/HashSet.h ('k') | no next file » | 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) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 void swap(Vector& other) 798 void swap(Vector& other)
799 { 799 {
800 Base::swapVectorBuffer(other); 800 Base::swapVectorBuffer(other);
801 std::swap(m_size, other.m_size); 801 std::swap(m_size, other.m_size);
802 } 802 }
803 803
804 void reverse(); 804 void reverse();
805 805
806 template <typename VisitorDispatcher> void trace(VisitorDispatcher); 806 template <typename VisitorDispatcher> void trace(VisitorDispatcher);
807 807
808 class GCForbiddenScope {
809 STACK_ALLOCATED();
810 public:
811 GCForbiddenScope()
812 {
813 Allocator::enterGCForbiddenScope();
814 }
815 ~GCForbiddenScope()
816 {
817 Allocator::leaveGCForbiddenScope();
818 }
819 };
820
808 protected: 821 protected:
809 using Base::checkUnusedSlots; 822 using Base::checkUnusedSlots;
810 using Base::clearUnusedSlots; 823 using Base::clearUnusedSlots;
811 824
812 private: 825 private:
813 void expandCapacity(size_t newMinCapacity); 826 void expandCapacity(size_t newMinCapacity);
814 T* expandCapacity(size_t newMinCapacity, T*); 827 T* expandCapacity(size_t newMinCapacity, T*);
815 T* expandCapacity(size_t newMinCapacity, const T* data) 828 T* expandCapacity(size_t newMinCapacity, const T* data)
816 { 829 {
817 return expandCapacity(newMinCapacity, const_cast<T*>(data)); 830 return expandCapacity(newMinCapacity, const_cast<T*>(data));
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
1368 STATIC_ONLY(NeedsTracing); 1381 STATIC_ONLY(NeedsTracing);
1369 static const bool value = false; 1382 static const bool value = false;
1370 }; 1383 };
1371 #endif 1384 #endif
1372 1385
1373 } // namespace WTF 1386 } // namespace WTF
1374 1387
1375 using WTF::Vector; 1388 using WTF::Vector;
1376 1389
1377 #endif // WTF_Vector_h 1390 #endif // WTF_Vector_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/HashSet.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698