Files
cefsharp/CefSharp.Core/Internals/CookieVisitor.cpp
T
amaitland ae1e6c4f3e Cleanup CefTime handling - make consistent across all projects
# Conflicts:
#	CefSharp.Core/ResourceHandlerWrapper.cpp
2018-01-22 11:32:26 +10:00

36 lines
1.3 KiB
C++

// Copyright © 2010-2017 The CefSharp 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 "Stdafx.h"
#include "CookieVisitor.h"
namespace CefSharp
{
bool CookieVisitor::Visit(const CefCookie& cefCookie, int count, int total, bool& deleteCookie)
{
auto cookie = gcnew Cookie();
String^ cookieName = StringUtils::ToClr(cefCookie.name);
if (!String::IsNullOrEmpty(cookieName))
{
cookie->Name = StringUtils::ToClr(cefCookie.name);
cookie->Value = StringUtils::ToClr(cefCookie.value);
cookie->Domain = StringUtils::ToClr(cefCookie.domain);
cookie->Path = StringUtils::ToClr(cefCookie.path);
cookie->Secure = cefCookie.secure == 1;
cookie->HttpOnly = cefCookie.httponly == 1;
if (cefCookie.has_expires)
{
cookie->Expires = DateTimeUtils::FromCefTime(CefTime(cefCookie.expires).GetDoubleT());
}
cookie->Creation = DateTimeUtils::FromCefTime(CefTime(cefCookie.creation).GetDoubleT());
cookie->LastAccess = DateTimeUtils::FromCefTime(CefTime(cefCookie.last_access).GetDoubleT());
}
return _visitor->Visit(cookie, count, total, deleteCookie);
}
}