diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-26 23:56:43 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-26 23:56:43 +0900 |
| commit | da7400ef5c62ee144fc14ba7ca4745349f0b0c72 (patch) | |
| tree | b0d023eecfcfcca2a88eb3466baf878bdff9f4c1 /src/DownloadEngine.cc | |
| parent | 47402c5f29cb806f73aae2ed18aa2dde21956700 (diff) | |
Return std::unique_ptr member as const ref
Returning raw pointer has a risk that it may be stolen by
std::shared_ptr in accident.
Diffstat (limited to 'src/DownloadEngine.cc')
| -rw-r--r-- | src/DownloadEngine.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/DownloadEngine.cc b/src/DownloadEngine.cc index d845ff1d..8de6a316 100644 --- a/src/DownloadEngine.cc +++ b/src/DownloadEngine.cc @@ -549,14 +549,15 @@ void DownloadEngine::setAuthConfigFactory authConfigFactory_ = std::move(factory); } -AuthConfigFactory* DownloadEngine::getAuthConfigFactory() const +const std::unique_ptr<AuthConfigFactory>& +DownloadEngine::getAuthConfigFactory() const { - return authConfigFactory_.get(); + return authConfigFactory_; } -CookieStorage* DownloadEngine::getCookieStorage() const +const std::unique_ptr<CookieStorage>& DownloadEngine::getCookieStorage() const { - return cookieStorage_.get(); + return cookieStorage_; } void DownloadEngine::setRefreshInterval(int64_t interval) |
