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

Side by Side Diff: net/quic/core/quic_arena_scoped_ptr.h

Issue 2193073003: Move shared files in net/quic/ into net/quic/core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: io_thread_unittest.cc Created 4 years, 4 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 | « net/quic/core/quic_alarm_test.cc ('k') | net/quic/core/quic_arena_scoped_ptr_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // unique_ptr-style pointer that stores values that may be from an arena. Takes 5 // unique_ptr-style pointer that stores values that may be from an arena. Takes
6 // up the same storage as the platform's native pointer type. Takes ownership 6 // up the same storage as the platform's native pointer type. Takes ownership
7 // of the value it's constructed with; if holding a value in an arena, and the 7 // of the value it's constructed with; if holding a value in an arena, and the
8 // type has a non-trivial destructor, the arena must outlive the 8 // type has a non-trivial destructor, the arena must outlive the
9 // QuicArenaScopedPtr. Does not support array overloads. 9 // QuicArenaScopedPtr. Does not support array overloads.
10 10
11 #ifndef NET_QUIC_QUIC_ARENA_SCOPED_PTR_H_ 11 #ifndef NET_QUIC_QUIC_ARENA_SCOPED_PTR_H_
12 #define NET_QUIC_QUIC_ARENA_SCOPED_PTR_H_ 12 #define NET_QUIC_QUIC_ARENA_SCOPED_PTR_H_
13 13
14 #include <cstdint> // for uintptr_t 14 #include <cstdint> // for uintptr_t
15 15
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "net/quic/quic_utils.h" 18 #include "net/quic/core/quic_utils.h"
19 19
20 namespace net { 20 namespace net {
21 21
22 template <typename T> 22 template <typename T>
23 class QuicArenaScopedPtr { 23 class QuicArenaScopedPtr {
24 static_assert(QUIC_ALIGN_OF(T*) > 1, 24 static_assert(QUIC_ALIGN_OF(T*) > 1,
25 "QuicArenaScopedPtr can only store objects that are aligned to " 25 "QuicArenaScopedPtr can only store objects that are aligned to "
26 "greater than 1 byte."); 26 "greater than 1 byte.");
27 27
28 public: 28 public:
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 case ConstructFrom::kArena: 201 case ConstructFrom::kArena:
202 value_ = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(value_) | 202 value_ = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(value_) |
203 QuicArenaScopedPtr<T>::kFromArenaMask); 203 QuicArenaScopedPtr<T>::kFromArenaMask);
204 break; 204 break;
205 } 205 }
206 } 206 }
207 207
208 } // namespace net 208 } // namespace net
209 209
210 #endif // NET_QUIC_QUIC_ARENA_SCOPED_PTR_H_ 210 #endif // NET_QUIC_QUIC_ARENA_SCOPED_PTR_H_
OLDNEW
« no previous file with comments | « net/quic/core/quic_alarm_test.cc ('k') | net/quic/core/quic_arena_scoped_ptr_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698