Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / browsing_data / canonical_cookie_hash.cc
1 // Copyright 2014 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 "chrome/browser/browsing_data/canonical_cookie_hash.h"
6
7 #include "base/hash.h"
8
9 namespace canonical_cookie {
10
11 size_t FastHash(const net::CanonicalCookie& cookie) {
12   return base::SuperFastHash(cookie.Name().c_str(), cookie.Name().size()) +
13          3 * base::SuperFastHash(cookie.Domain().c_str(),
14                                  cookie.Domain().size()) +
15          7 * base::SuperFastHash(cookie.Path().c_str(), cookie.Path().size());
16 }
17
18 };  // namespace canonical_cookie