OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 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 "content/browser/net/cookie_store_map_impl.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "net/cookies/cookie_store.h" |
| 9 |
| 10 namespace content { |
| 11 |
| 12 CookieStoreMapImpl::CookieStoreMapImpl() { |
| 13 } |
| 14 |
| 15 CookieStoreMapImpl::~CookieStoreMapImpl() { |
| 16 } |
| 17 |
| 18 net::CookieStore* CookieStoreMapImpl::GetForScheme( |
| 19 const std::string& scheme) const { |
| 20 MapType::const_iterator it = scheme_map_.find(scheme); |
| 21 if (it == scheme_map_.end()) |
| 22 return NULL; |
| 23 return it->second; |
| 24 } |
| 25 |
| 26 void CookieStoreMapImpl::SetForScheme(const std::string& scheme, |
| 27 net::CookieStore* cookie_store) { |
| 28 DCHECK(scheme_map_.find(scheme) == scheme_map_.end()); |
| 29 DCHECK(cookie_store); |
| 30 scheme_map_[scheme] = cookie_store; |
| 31 } |
| 32 |
| 33 CookieStoreMap* CookieStoreMapImpl::Clone() const { |
| 34 CookieStoreMapImpl* cloned_map = new CookieStoreMapImpl(); |
| 35 cloned_map->scheme_map_ = scheme_map_; |
| 36 return cloned_map; |
| 37 } |
| 38 |
| 39 } // namespace content |
OLD | NEW |