Chromium Code Reviews| Index: chrome/browser/chromeos/login/helper.cc |
| diff --git a/chrome/browser/chromeos/login/helper.cc b/chrome/browser/chromeos/login/helper.cc |
| index afe1bf41c12aceddfa83632945d7c3b89c4394fa..f6d528cba8500b201e4de5d1568aef78a7ecad44 100644 |
| --- a/chrome/browser/chromeos/login/helper.cc |
| +++ b/chrome/browser/chromeos/login/helper.cc |
| @@ -153,8 +153,19 @@ content::StoragePartition* GetSigninPartition() { |
| } |
| net::URLRequestContextGetter* GetSigninContext() { |
| - if (StartupUtils::IsWebviewSigninEnabled()) |
| - return GetSigninPartition()->GetURLRequestContext(); |
| + if (StartupUtils::IsWebviewSigninEnabled()) { |
| + content::StoragePartition* signin_partition = GetSigninPartition(); |
| + |
| + // Special case for unit tests. There's no LoginDisplayHost thus no |
| + // webview instance. |
| + if (!signin_partition && !LoginDisplayHostImpl::default_host()) |
|
dzhioev (left Google)
2015/04/15 17:36:24
Please try to return nullptr in this case. Or at l
Nikita (slow)
2015/04/15 18:35:42
Returning nullptr here wouldn't work as UserCloudP
|
| + return ProfileHelper::GetSigninProfile()->GetRequestContext(); |
| + |
| + if (!signin_partition) |
| + return nullptr; |
| + |
| + return signin_partition->GetURLRequestContext(); |
| + } |
| return ProfileHelper::GetSigninProfile()->GetRequestContext(); |
| } |