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

Side by Side Diff: Source/wtf/HashTraits.h

Issue 14763003: HashTraits<RefPtr<P> >::PeekType should be raw pointer for better performance (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 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 | « Source/modules/mediastream/MediaStreamRegistry.cpp ('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, 2011, 2012 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights reserv ed.
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 { 142 {
143 static RefPtr<P>& null = *(new RefPtr<P>); 143 static RefPtr<P>& null = *(new RefPtr<P>);
144 return null; 144 return null;
145 } 145 }
146 146
147 typedef PassRefPtr<P> PassInType; 147 typedef PassRefPtr<P> PassInType;
148 static void store(PassRefPtr<P> value, RefPtr<P>& storage) { storage = v alue; } 148 static void store(PassRefPtr<P> value, RefPtr<P>& storage) { storage = v alue; }
149 149
150 typedef PassRefPtr<P> PassOutType; 150 typedef PassRefPtr<P> PassOutType;
151 static PassRefPtr<P> passOut(RefPtr<P>& value) { return value.release(); } 151 static PassRefPtr<P> passOut(RefPtr<P>& value) { return value.release(); }
152 // FIXME: We should consider changing PeekType to a raw pointer for bett er performance, 152
153 // but then callers won't need to call get; doing so will require updati ng many call sites. 153 typedef P* PeekType;
154 static PeekType peek(const RefPtr<P>& value) { return value.get(); }
154 }; 155 };
155 156
156 template<> struct HashTraits<String> : SimpleClassHashTraits<String> { 157 template<> struct HashTraits<String> : SimpleClassHashTraits<String> {
157 static const bool hasIsEmptyValueFunction = true; 158 static const bool hasIsEmptyValueFunction = true;
158 static bool isEmptyValue(const String&); 159 static bool isEmptyValue(const String&);
159 }; 160 };
160 161
161 // This struct template is an implementation detail of the isHashTraitsEmpty Value function, 162 // This struct template is an implementation detail of the isHashTraitsEmpty Value function,
162 // which selects either the emptyValue function or the isEmptyValue function to check for empty values. 163 // which selects either the emptyValue function or the isEmptyValue function to check for empty values.
163 template<typename Traits, bool hasEmptyValueFunction> struct HashTraitsEmpty ValueChecker; 164 template<typename Traits, bool hasEmptyValueFunction> struct HashTraitsEmpty ValueChecker;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 }; 247 };
247 248
248 } // namespace WTF 249 } // namespace WTF
249 250
250 using WTF::HashTraits; 251 using WTF::HashTraits;
251 using WTF::PairHashTraits; 252 using WTF::PairHashTraits;
252 using WTF::NullableHashTraits; 253 using WTF::NullableHashTraits;
253 using WTF::SimpleClassHashTraits; 254 using WTF::SimpleClassHashTraits;
254 255
255 #endif // WTF_HashTraits_h 256 #endif // WTF_HashTraits_h
OLDNEW
« no previous file with comments | « Source/modules/mediastream/MediaStreamRegistry.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698