Change CreateWebUIControllerForURL() to return a unique_ptr

1087627
This commit is contained in:
Jeremy Apthorp 2018-10-02 12:11:56 -07:00
parent c576d442fd
commit 2a3a845262
4 changed files with 14 additions and 9 deletions

View file

@ -52,7 +52,7 @@ bool AtomWebUIControllerFactory::UseWebUIBindingsForURL(
return UseWebUIForURL(browser_context, url);
}
content::WebUIController*
std::unique_ptr<content::WebUIController>
AtomWebUIControllerFactory::CreateWebUIControllerForURL(content::WebUI* web_ui,
const GURL& url) const {
#if BUILDFLAG(ENABLE_PDF_VIEWER)
@ -78,7 +78,7 @@ AtomWebUIControllerFactory::CreateWebUIControllerForURL(content::WebUI* web_ui,
return new PdfViewerUI(browser_context, web_ui, src);
}
#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
return nullptr;
return std::unique_ptr<content::WebUIController>();
}
} // namespace atom

View file

@ -5,8 +5,11 @@
#ifndef ATOM_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_
#define ATOM_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_
#include <memory>
#include "base/macros.h"
#include "base/memory/singleton.h"
#include "content/public/browser/web_ui_controller.h"
#include "content/public/browser/web_ui_controller_factory.h"
namespace atom {
@ -25,7 +28,7 @@ class AtomWebUIControllerFactory : public content::WebUIControllerFactory {
const GURL& url) const override;
bool UseWebUIBindingsForURL(content::BrowserContext* browser_context,
const GURL& url) const override;
content::WebUIController* CreateWebUIControllerForURL(
std::unique_ptr<content::WebUIController> CreateWebUIControllerForURL(
content::WebUI* web_ui,
const GURL& url) const override;