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

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

Issue 1916703002: Prepare for move-only PassOwnPtr in the remaining directories. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@core1
Patch Set: Merge with trunk. Created 4 years, 8 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) 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 typedef std::nullptr_t EmptyValueType; 165 typedef std::nullptr_t EmptyValueType;
166 166
167 static EmptyValueType emptyValue() { return nullptr; } 167 static EmptyValueType emptyValue() { return nullptr; }
168 168
169 static const bool hasIsEmptyValueFunction = true; 169 static const bool hasIsEmptyValueFunction = true;
170 static bool isEmptyValue(const OwnPtr<P>& value) { return !value; } 170 static bool isEmptyValue(const OwnPtr<P>& value) { return !value; }
171 171
172 typedef typename OwnPtr<P>::PtrType PeekInType; 172 typedef typename OwnPtr<P>::PtrType PeekInType;
173 173
174 typedef PassOwnPtr<P> PassInType; 174 typedef PassOwnPtr<P> PassInType;
175 static void store(PassOwnPtr<P> value, OwnPtr<P>& storage) { storage = value ; } 175 static void store(PassOwnPtr<P> value, OwnPtr<P>& storage) { storage = std:: move(value); }
176 176
177 typedef PassOwnPtr<P> PassOutType; 177 typedef PassOwnPtr<P> PassOutType;
178 static PassOwnPtr<P> passOut(OwnPtr<P>& value) { return value.release(); } 178 static PassOwnPtr<P> passOut(OwnPtr<P>& value) { return value.release(); }
179 static PassOwnPtr<P> passOut(std::nullptr_t) { return nullptr; } 179 static PassOwnPtr<P> passOut(std::nullptr_t) { return nullptr; }
180 180
181 typedef typename OwnPtr<P>::PtrType PeekOutType; 181 typedef typename OwnPtr<P>::PtrType PeekOutType;
182 static PeekOutType peek(const OwnPtr<P>& value) { return value.get(); } 182 static PeekOutType peek(const OwnPtr<P>& value) { return value.get(); }
183 static PeekOutType peek(std::nullptr_t) { return 0; } 183 static PeekOutType peek(std::nullptr_t) { return 0; }
184 }; 184 };
185 185
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 struct TraceInCollectionTrait; 367 struct TraceInCollectionTrait;
368 368
369 } // namespace WTF 369 } // namespace WTF
370 370
371 using WTF::HashTraits; 371 using WTF::HashTraits;
372 using WTF::PairHashTraits; 372 using WTF::PairHashTraits;
373 using WTF::NullableHashTraits; 373 using WTF::NullableHashTraits;
374 using WTF::SimpleClassHashTraits; 374 using WTF::SimpleClassHashTraits;
375 375
376 #endif // WTF_HashTraits_h 376 #endif // WTF_HashTraits_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/Functional.h ('k') | third_party/WebKit/public/platform/WebContentSettingCallbacks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698