Home | History | Annotate | Download | only in http
      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
      3 // found in the LICENSE file.
      4 
      5 #include "base/logging.h"
      6 #include "net/http/http_auth_handler.h"
      7 
      8 namespace net {
      9 
     10 bool HttpAuthHandler::InitFromChallenge(std::string::const_iterator begin,
     11                                         std::string::const_iterator end,
     12                                         HttpAuth::Target target,
     13                                         const GURL& origin) {
     14   origin_ = origin;
     15   target_ = target;
     16   score_ = -1;
     17   properties_ = -1;
     18 
     19   bool ok = Init(begin, end);
     20 
     21   // Init() is expected to set the scheme, realm, score, and properties.  The
     22   // realm may be empty.
     23   DCHECK(!ok || !scheme().empty());
     24   DCHECK(!ok || score_ != -1);
     25   DCHECK(!ok || properties_ != -1);
     26 
     27   return ok;
     28 }
     29 
     30 }  // namespace net
     31