| Index: net/cookies/cookie_constants.cc | 
| diff --git a/net/cookies/cookie_constants.cc b/net/cookies/cookie_constants.cc | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..ba76f2c6c89a09f62e072b62fd9f85b7b86b47af | 
| --- /dev/null | 
| +++ b/net/cookies/cookie_constants.cc | 
| @@ -0,0 +1,46 @@ | 
| +// Copyright 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 "net/cookies/cookie_constants.h" | 
| + | 
| +#include "base/logging.h" | 
| +#include "base/string_util.h" | 
| + | 
| +namespace net { | 
| + | 
| +namespace { | 
| +const char kPriorityLow[] = "low"; | 
| +const char kPriorityMedium[] = "medium"; | 
| +const char kPriorityHigh[] = "high"; | 
| +}  // namespace | 
| + | 
| +NET_EXPORT const std::string CookiePriorityToString(CookiePriority priority) { | 
| +  switch(priority) { | 
| +    case COOKIE_PRIORITY_HIGH: | 
| +      return kPriorityHigh; | 
| +    case COOKIE_PRIORITY_MEDIUM: | 
| +      return kPriorityMedium; | 
| +    case COOKIE_PRIORITY_LOW: | 
| +      return kPriorityLow; | 
| +    default: | 
| +      NOTREACHED(); | 
| +  } | 
| +  return std::string(); | 
| +} | 
| + | 
| +NET_EXPORT CookiePriority StringToCookiePriority(const std::string& priority) { | 
| +  std::string priority_comp(priority); | 
| +  StringToLowerASCII(&priority_comp); | 
| + | 
| +  if (priority_comp == kPriorityHigh) | 
| +    return COOKIE_PRIORITY_HIGH; | 
| +  if (priority_comp == kPriorityMedium) | 
| +    return COOKIE_PRIORITY_MEDIUM; | 
| +  if (priority_comp == kPriorityLow) | 
| +    return COOKIE_PRIORITY_LOW; | 
| + | 
| +  return COOKIE_PRIORITY_DEFAULT; | 
| +} | 
| + | 
| +}  // namespace net | 
|  |