OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef Maybe_h | 5 #ifndef Maybe_h |
6 #define Maybe_h | 6 #define Maybe_h |
7 | 7 |
8 #include "platform/inspector_protocol/Platform.h" | 8 //#include "Platform.h" |
9 #include "platform/inspector_protocol/String16.h" | 9 //#include "String16.h" |
10 | |
11 #include <memory> | |
12 | 10 |
13 namespace blink { | 11 namespace blink { |
14 namespace protocol { | 12 namespace protocol { |
15 | 13 |
16 template<typename T> | 14 template<typename T> |
17 class Maybe { | 15 class Maybe { |
18 public: | 16 public: |
19 Maybe() : m_value() { } | 17 Maybe() : m_value() { } |
20 Maybe(std::unique_ptr<T> value) : m_value(std::move(value)) { } | 18 Maybe(std::unique_ptr<T> value) : m_value(std::move(value)) { } |
21 void operator=(std::unique_ptr<T> value) { m_value = std::move(value); } | 19 void operator=(std::unique_ptr<T> value) { m_value = std::move(value); } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 public: | 78 public: |
81 Maybe() { } | 79 Maybe() { } |
82 Maybe(const String16& value) : MaybeBase(value) { } | 80 Maybe(const String16& value) : MaybeBase(value) { } |
83 using MaybeBase::operator=; | 81 using MaybeBase::operator=; |
84 }; | 82 }; |
85 | 83 |
86 } // namespace platform | 84 } // namespace platform |
87 } // namespace blink | 85 } // namespace blink |
88 | 86 |
89 #endif // !defined(Maybe_h) | 87 #endif // !defined(Maybe_h) |
OLD | NEW |