Take advantage of implicit std::unique_ptr<>(nulltpr_t) ctor.

Review-Url: https://codereview.chromium.org/2453163002
diff --git a/core/fpdfapi/font/cpdf_font.cpp b/core/fpdfapi/font/cpdf_font.cpp
index d39f752..c5da4ea 100644
--- a/core/fpdfapi/font/cpdf_font.cpp
+++ b/core/fpdfapi/font/cpdf_font.cpp
@@ -343,7 +343,7 @@
   pFont->m_pFontDict = pFontDict;
   pFont->m_pDocument = pDoc;
   pFont->m_BaseFont = pFontDict->GetStringFor("BaseFont");
-  return pFont->Load() ? std::move(pFont) : std::unique_ptr<CPDF_Font>();
+  return pFont->Load() ? std::move(pFont) : nullptr;
 }
 
 uint32_t CPDF_Font::GetNextChar(const FX_CHAR* pString,
diff --git a/core/fpdfapi/page/cpdf_clippath.cpp b/core/fpdfapi/page/cpdf_clippath.cpp
index 8c268a1..9d4b737 100644
--- a/core/fpdfapi/page/cpdf_clippath.cpp
+++ b/core/fpdfapi/page/cpdf_clippath.cpp
@@ -100,7 +100,7 @@
   if (pData->m_TextList.size() + pTexts->size() <= FPDF_CLIPPATH_MAX_TEXTS) {
     for (size_t i = 0; i < pTexts->size(); i++)
       pData->m_TextList.push_back(std::move((*pTexts)[i]));
-    pData->m_TextList.push_back(std::unique_ptr<CPDF_TextObject>());
+    pData->m_TextList.push_back(nullptr);
   }
   pTexts->clear();
 }
diff --git a/core/fpdfapi/page/cpdf_colorspace.cpp b/core/fpdfapi/page/cpdf_colorspace.cpp
index fe840d1..e43bacc 100644
--- a/core/fpdfapi/page/cpdf_colorspace.cpp
+++ b/core/fpdfapi/page/cpdf_colorspace.cpp
@@ -332,7 +332,7 @@
 std::unique_ptr<CPDF_ColorSpace> CPDF_ColorSpace::Load(CPDF_Document* pDoc,
                                                        CPDF_Object* pObj) {
   if (!pObj)
-    return std::unique_ptr<CPDF_ColorSpace>();
+    return nullptr;
 
   if (pObj->IsName()) {
     return std::unique_ptr<CPDF_ColorSpace>(
@@ -341,7 +341,7 @@
   if (CPDF_Stream* pStream = pObj->AsStream()) {
     CPDF_Dictionary* pDict = pStream->GetDict();
     if (!pDict)
-      return std::unique_ptr<CPDF_ColorSpace>();
+      return nullptr;
 
     for (const auto& it : *pDict) {
       std::unique_ptr<CPDF_ColorSpace> pRet;
@@ -351,16 +351,16 @@
       if (pRet)
         return pRet;
     }
-    return std::unique_ptr<CPDF_ColorSpace>();
+    return nullptr;
   }
 
   CPDF_Array* pArray = pObj->AsArray();
   if (!pArray || pArray->IsEmpty())
-    return std::unique_ptr<CPDF_ColorSpace>();
+    return nullptr;
 
   CPDF_Object* pFamilyObj = pArray->GetDirectObjectAt(0);
   if (!pFamilyObj)
-    return std::unique_ptr<CPDF_ColorSpace>();
+    return nullptr;
 
   CFX_ByteString familyname = pFamilyObj->GetString();
   if (pArray->GetCount() == 1)
@@ -386,11 +386,11 @@
   } else if (id == FXBSTR_ID('P', 'a', 't', 't')) {
     pCS.reset(new CPDF_PatternCS(pDoc));
   } else {
-    return std::unique_ptr<CPDF_ColorSpace>();
+    return nullptr;
   }
   pCS->m_pArray = pArray;
   if (!pCS->v_Load(pDoc, pArray))
-    return std::unique_ptr<CPDF_ColorSpace>();
+    return nullptr;
 
   return pCS;
 }
diff --git a/core/fpdfapi/page/fpdf_page_func.cpp b/core/fpdfapi/page/fpdf_page_func.cpp
index a2e31f9..df65884 100644
--- a/core/fpdfapi/page/fpdf_page_func.cpp
+++ b/core/fpdfapi/page/fpdf_page_func.cpp
@@ -751,7 +751,8 @@
     pFunc.reset(new CPDF_PSFunc());
 
   if (!pFunc || !pFunc->Init(pFuncObj))
-    return std::unique_ptr<CPDF_Function>();
+    return nullptr;
+
   return pFunc;
 }
 
diff --git a/core/fpdfapi/render/fpdf_render_pattern.cpp b/core/fpdfapi/render/fpdf_render_pattern.cpp
index f55a0e8..5238550 100644
--- a/core/fpdfapi/render/fpdf_render_pattern.cpp
+++ b/core/fpdfapi/render/fpdf_render_pattern.cpp
@@ -819,7 +819,7 @@
   std::unique_ptr<CFX_DIBitmap> pBitmap(new CFX_DIBitmap);
   if (!pBitmap->Create(width, height,
                        pPattern->colored() ? FXDIB_Argb : FXDIB_8bppMask)) {
-    return std::unique_ptr<CFX_DIBitmap>();
+    return nullptr;
   }
   CFX_FxgeDevice bitmap_device;
   bitmap_device.Attach(pBitmap.get(), false, nullptr, false);
diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp
index b626115..4821f8e 100644
--- a/core/fpdfdoc/cpdf_annotlist.cpp
+++ b/core/fpdfdoc/cpdf_annotlist.cpp
@@ -25,13 +25,13 @@
                                              CPDF_Document* pDocument) {
   CPDF_Dictionary* pParentDict = pAnnot->GetAnnotDict();
   if (!pParentDict)
-    return std::unique_ptr<CPDF_Annot>();
+    return nullptr;
 
   // TODO(jaepark): We shouldn't strip BOM for some strings and not for others.
   // See pdfium:593.
   CFX_WideString sContents = pParentDict->GetUnicodeTextFor("Contents");
   if (sContents.IsEmpty())
-    return std::unique_ptr<CPDF_Annot>();
+    return nullptr;
 
   CPDF_Dictionary* pAnnotDict =
       new CPDF_Dictionary(pDocument->GetByteStringPool());
diff --git a/fpdfsdk/fpdf_progressive.cpp b/fpdfsdk/fpdf_progressive.cpp
index 1933c88..13349cd 100644
--- a/fpdfsdk/fpdf_progressive.cpp
+++ b/fpdfsdk/fpdf_progressive.cpp
@@ -91,5 +91,5 @@
     return;
 
   pContext->m_pDevice->RestoreState(false);
-  pPage->SetRenderContext(std::unique_ptr<CPDF_PageRenderContext>());
+  pPage->SetRenderContext(nullptr);
 }
diff --git a/fpdfsdk/fpdfdoc_unittest.cpp b/fpdfsdk/fpdfdoc_unittest.cpp
index fc85404..48be723 100644
--- a/fpdfsdk/fpdfdoc_unittest.cpp
+++ b/fpdfsdk/fpdfdoc_unittest.cpp
@@ -25,7 +25,7 @@
 
 class CPDF_TestDocument : public CPDF_Document {
  public:
-  CPDF_TestDocument() : CPDF_Document(std::unique_ptr<CPDF_Parser>()) {}
+  CPDF_TestDocument() : CPDF_Document(nullptr) {}
 
   void SetRoot(CPDF_Dictionary* root) { m_pRootDict = root; }
   CPDF_IndirectObjectHolder* GetHolder() { return this; }
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index 92ca34e..be56c53 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -575,7 +575,7 @@
     }
   }
 
-  pPage->SetRenderContext(std::unique_ptr<CPDF_PageRenderContext>());
+  pPage->SetRenderContext(nullptr);
 }
 #endif  // defined(_WIN32)
 
@@ -604,7 +604,7 @@
   FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y,
                          rotate, flags, TRUE, nullptr);
 
-  pPage->SetRenderContext(std::unique_ptr<CPDF_PageRenderContext>());
+  pPage->SetRenderContext(nullptr);
 }
 
 #ifdef _SKIA_SUPPORT_
@@ -622,7 +622,7 @@
   pContext->m_pDevice.reset(skDevice);
   FPDF_RenderPage_Retail(pContext, page, 0, 0, size_x, size_y, 0, 0, TRUE,
                          nullptr);
-  pPage->SetRenderContext(std::unique_ptr<CPDF_PageRenderContext>());
+  pPage->SetRenderContext(nullptr);
   return recorder;
 }
 #endif
diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/pdfwindow/PWL_FontMap.cpp
index a6f79e2..b2a1f25 100644
--- a/fpdfsdk/pdfwindow/PWL_FontMap.cpp
+++ b/fpdfsdk/pdfwindow/PWL_FontMap.cpp
@@ -48,8 +48,7 @@
 CPDF_Document* CPWL_FontMap::GetDocument() {
   if (!m_pPDFDoc) {
     if (CPDF_ModuleMgr::Get()) {
-      m_pPDFDoc =
-          pdfium::MakeUnique<CPDF_Document>(std::unique_ptr<CPDF_Parser>());
+      m_pPDFDoc = pdfium::MakeUnique<CPDF_Document>(nullptr);
       m_pPDFDoc->CreateNewDoc();
     }
   }
diff --git a/xfa/fgas/crt/fgas_memory.cpp b/xfa/fgas/crt/fgas_memory.cpp
index c68241f..0cccdc7 100644
--- a/xfa/fgas/crt/fgas_memory.cpp
+++ b/xfa/fgas/crt/fgas_memory.cpp
@@ -100,7 +100,7 @@
 #endif  // MEMORY_TOOL_REPLACES_ALLOCATOR
     default:
       ASSERT(0);
-      return std::unique_ptr<IFX_MemoryAllocator>();
+      return nullptr;
   }
 }