mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 19:25:01 +00:00
9262d731d5
Call delete in CefResponseFilterAdapter destructor
41 lines
965 B
C#
41 lines
965 B
C#
// Copyright © 2010-2016 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.
|
|
|
|
using System;
|
|
using System.IO;
|
|
|
|
namespace CefSharp.Example.Filters
|
|
{
|
|
public class PassThruResponseFilter : IResponseFilter
|
|
{
|
|
bool IResponseFilter.InitFilter()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
FilterStatus IResponseFilter.Filter(Stream dataIn, out long dataInRead, Stream dataOut, out long dataOutWritten)
|
|
{
|
|
if(dataIn == null)
|
|
{
|
|
dataInRead = 0;
|
|
dataOutWritten = 0;
|
|
|
|
return FilterStatus.Done;
|
|
}
|
|
|
|
dataInRead = dataIn.Length;
|
|
dataOutWritten = Math.Min(dataInRead, dataOut.Length);
|
|
|
|
dataIn.CopyTo(dataOut);
|
|
|
|
return FilterStatus.Done;
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|