| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "net/http/http_auth_handler.h" | 6 #include "net/http/http_auth_handler.h" |
| 7 | 7 |
| 8 namespace net { | 8 namespace net { |
| 9 | 9 |
| 10 bool HttpAuthHandler::InitFromChallenge(std::string::const_iterator begin, | 10 bool HttpAuthHandler::InitFromChallenge(std::string::const_iterator begin, |
| 11 std::string::const_iterator end, | 11 std::string::const_iterator end, |
| 12 HttpAuth::Target target) { | 12 HttpAuth::Target target) { |
| 13 target_ = target; | 13 target_ = target; |
| 14 score_ = -1; | 14 score_ = -1; |
| 15 properties_ = -1; |
| 15 | 16 |
| 16 bool ok = Init(begin, end); | 17 bool ok = Init(begin, end); |
| 17 | 18 |
| 18 // Init() is expected to set the scheme, realm, and score. | 19 // Init() is expected to set the scheme, realm, score, and properties. The |
| 20 // realm may be empty. |
| 19 DCHECK(!ok || !scheme().empty()); | 21 DCHECK(!ok || !scheme().empty()); |
| 20 DCHECK(!ok || !realm().empty()); | |
| 21 DCHECK(!ok || score_ != -1); | 22 DCHECK(!ok || score_ != -1); |
| 22 | 23 DCHECK(!ok || properties_ != -1); |
| 24 |
| 23 return ok; | 25 return ok; |
| 24 } | 26 } |
| 25 | 27 |
| 26 } // namespace net | 28 } // namespace net |
| OLD | NEW |