mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 11:42:36 +00:00
68dc297e68
Speculative fix for #3779
40 lines
988 B
C++
40 lines
988 B
C++
// Copyright © 2014 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.
|
|
|
|
#pragma once
|
|
|
|
#include "Stdafx.h"
|
|
#include "include/cef_string_visitor.h"
|
|
|
|
namespace CefSharp
|
|
{
|
|
namespace Internals
|
|
{
|
|
private class CefStringVisitorAdapter : public CefStringVisitor
|
|
{
|
|
private:
|
|
gcroot<IStringVisitor^> _visitor;
|
|
|
|
public:
|
|
CefStringVisitorAdapter(IStringVisitor^ visitor) :
|
|
_visitor(visitor)
|
|
{
|
|
}
|
|
|
|
~CefStringVisitorAdapter()
|
|
{
|
|
delete _visitor;
|
|
_visitor = nullptr;
|
|
}
|
|
|
|
virtual void Visit(const CefString& string) override
|
|
{
|
|
_visitor->Visit(string.empty() ? String::Empty : StringUtils::ToClr(string));
|
|
}
|
|
|
|
IMPLEMENT_REFCOUNTINGM(CefStringVisitorAdapter);
|
|
};
|
|
}
|
|
}
|