blob: 6b177415c62137e7fd4ebc7956908881dfbd3ac0 [file] [log] [blame]
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
namespace net {
class URLRequest;
namespace android_webview {
enum RealmRestriction {
struct HeaderData {
// "realm" string from x-auto-login (e.g. "").
std::string realm;
// "account" string from x-auto-login.
std::string account;
// "args" string from x-auto-login to be passed to MergeSession. This string
// should be considered opaque and not be cracked open to look inside.
std::string args;
// Returns whether parsing succeeded. Parameter |header_data| will not be
// modified if parsing fails.
bool ParseHeader(const std::string& header,
RealmRestriction realm_restriction,
HeaderData* header_data);
// Helper function that also retrieves the header from the response of the
// given URLRequest.
bool ParserHeaderInResponse(net::URLRequest* request,
RealmRestriction realm_restriction,
HeaderData* header_data);
} // namespace android_webview