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

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

Issue 14998005: HashTraits<RefPtr<P> >::peek should consider empty value (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 | « no previous file | 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 152
153 typedef P* PeekType; 153 typedef P* PeekType;
154 static PeekType peek(const RefPtr<P>& value) { return value.get(); } 154 static PeekType peek(const RefPtr<P>& value) { return value.get(); }
155 static PeekType peek(P* value) { return value; }
155 }; 156 };
156 157
157 template<> struct HashTraits<String> : SimpleClassHashTraits<String> { 158 template<> struct HashTraits<String> : SimpleClassHashTraits<String> {
158 static const bool hasIsEmptyValueFunction = true; 159 static const bool hasIsEmptyValueFunction = true;
159 static bool isEmptyValue(const String&); 160 static bool isEmptyValue(const String&);
160 }; 161 };
161 162
162 // This struct template is an implementation detail of the isHashTraitsEmpty Value function, 163 // This struct template is an implementation detail of the isHashTraitsEmpty Value function,
163 // which selects either the emptyValue function or the isEmptyValue function to check for empty values. 164 // which selects either the emptyValue function or the isEmptyValue function to check for empty values.
164 template<typename Traits, bool hasEmptyValueFunction> struct HashTraitsEmpty ValueChecker; 165 template<typename Traits, bool hasEmptyValueFunction> struct HashTraitsEmpty ValueChecker;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 }; 248 };
248 249
249 } // namespace WTF 250 } // namespace WTF
250 251
251 using WTF::HashTraits; 252 using WTF::HashTraits;
252 using WTF::PairHashTraits; 253 using WTF::PairHashTraits;
253 using WTF::NullableHashTraits; 254 using WTF::NullableHashTraits;
254 using WTF::SimpleClassHashTraits; 255 using WTF::SimpleClassHashTraits;
255 256
256 #endif // WTF_HashTraits_h 257 #endif // WTF_HashTraits_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698