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

Unified Diff: core/fxcrt/cfx_weak_ptr.h

Issue 2509123002: Make CPDF_Object subclass constructors intern strings (Closed)
Patch Set: Nits Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfdoc/cpvt_generateap.cpp ('k') | fpdfsdk/formfiller/cba_fontmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/cfx_weak_ptr.h
diff --git a/core/fxcrt/cfx_weak_ptr.h b/core/fxcrt/cfx_weak_ptr.h
index 9ac1475884d0f0f9b7194f118d4845e38fd25dbd..f679696992b93bd4fe0f72fb8821c50e4d3f071c 100644
--- a/core/fxcrt/cfx_weak_ptr.h
+++ b/core/fxcrt/cfx_weak_ptr.h
@@ -7,6 +7,7 @@
#ifndef CORE_FXCRT_CFX_WEAK_PTR_H_
#define CORE_FXCRT_CFX_WEAK_PTR_H_
+#include <cstddef>
#include <memory>
#include "core/fxcrt/cfx_retain_ptr.h"
@@ -21,6 +22,9 @@ class CFX_WeakPtr {
CFX_WeakPtr(std::unique_ptr<T, D> pObj)
: m_pHandle(new Handle(std::move(pObj))) {}
+ // Deliberately implicit to allow passing nullptr.
+ CFX_WeakPtr(std::nullptr_t arg) {}
+
explicit operator bool() const { return m_pHandle && !!m_pHandle->Get(); }
bool HasOneRef() const { return m_pHandle && m_pHandle->HasOneRef(); }
T* operator->() { return m_pHandle->Get(); }
« no previous file with comments | « core/fpdfdoc/cpvt_generateap.cpp ('k') | fpdfsdk/formfiller/cba_fontmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698