| Index: third_party/WebKit/Source/wtf/Optional.h
|
| diff --git a/third_party/WebKit/Source/wtf/Optional.h b/third_party/WebKit/Source/wtf/Optional.h
|
| index 1c2e422f522d6cb210e65f7ed6f71cf3597c6be4..a28bd804308c3e218f80c575ac77cabae5448102 100644
|
| --- a/third_party/WebKit/Source/wtf/Optional.h
|
| +++ b/third_party/WebKit/Source/wtf/Optional.h
|
| @@ -28,12 +28,14 @@ namespace WTF {
|
| // recorder.emplace(constructor, args, here);
|
| // // recorder destroyed at end of scope
|
| //
|
| +// It can be used in WTF::Vector.
|
| +//
|
| // Note in particular that unlike a pointer, though, dereferencing a const
|
| // optional yields a const reference.
|
|
|
| template <typename T>
|
| class Optional final {
|
| - DISALLOW_NEW();
|
| + DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
|
| WTF_MAKE_NONCOPYABLE(Optional);
|
| public:
|
| Optional() : m_ptr(nullptr) { }
|
| @@ -50,6 +52,8 @@ public:
|
| const T& operator*() const { ASSERT_WITH_SECURITY_IMPLICATION(m_ptr); return *m_ptr; }
|
| T* operator->() { ASSERT_WITH_SECURITY_IMPLICATION(m_ptr); return m_ptr; }
|
| const T* operator->() const { ASSERT_WITH_SECURITY_IMPLICATION(m_ptr); return m_ptr; }
|
| + T* get() { return m_ptr; }
|
| + const T* get() const { return m_ptr; }
|
|
|
| template <typename... Args>
|
| void emplace(Args&&... args)
|
|
|