mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 12:09:40 +00:00
Remove some unused WCF pieces now that native IPC is used to register js binding objects
This commit is contained in:
@@ -66,10 +66,6 @@ namespace CefSharp.BrowserSubprocess
|
||||
try
|
||||
{
|
||||
clientChannel.Open();
|
||||
if (!browser.IsPopup)
|
||||
{
|
||||
browserProcess.Connect();
|
||||
}
|
||||
|
||||
browser.ChannelFactory = channelFactory;
|
||||
browser.BrowserProcess = browserProcess;
|
||||
|
||||
@@ -46,11 +46,5 @@ namespace CefSharp.Internals
|
||||
|
||||
return new BrowserProcessResponse { Success = success, Result = null, Message = exception };
|
||||
}
|
||||
|
||||
public void Connect()
|
||||
{
|
||||
var context = OperationContext.Current;
|
||||
host.SetOperationContext(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ using System.Net.Security;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.ServiceModel.Description;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CefSharp.Internals
|
||||
{
|
||||
@@ -16,7 +15,6 @@ namespace CefSharp.Internals
|
||||
private const long OneHundredAndTwentyEightMegaBytesInBytes = 128*1024*1024;
|
||||
|
||||
public JavascriptObjectRepository JavascriptObjectRepository { get; private set; }
|
||||
private TaskCompletionSource<OperationContext> operationContextTaskCompletionSource = new TaskCompletionSource<OperationContext>();
|
||||
|
||||
public BrowserProcessServiceHost(JavascriptObjectRepository javascriptObjectRepository, int parentProcessId, IBrowserAdapter browserAdapter)
|
||||
: base(typeof(BrowserProcessService), new Uri[0])
|
||||
@@ -40,49 +38,10 @@ namespace CefSharp.Internals
|
||||
endPoint.Behaviors.Add(new JavascriptCallbackEndpointBehavior(browserAdapter.JavascriptCallbackFactory));
|
||||
}
|
||||
|
||||
public void SetOperationContext(OperationContext operationContext)
|
||||
{
|
||||
if (operationContextTaskCompletionSource.Task.Status == TaskStatus.RanToCompletion)
|
||||
{
|
||||
operationContextTaskCompletionSource = new TaskCompletionSource<OperationContext>();
|
||||
}
|
||||
|
||||
operationContextTaskCompletionSource.SetResult(operationContext);
|
||||
}
|
||||
|
||||
protected override void OnClose(TimeSpan timeout)
|
||||
{
|
||||
var task = operationContextTaskCompletionSource.Task;
|
||||
|
||||
CloseChannel(task);
|
||||
|
||||
base.OnClose(timeout);
|
||||
}
|
||||
|
||||
private void CloseChannel(Task<OperationContext> task)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (task.IsCompleted)
|
||||
{
|
||||
var context = task.Result;
|
||||
|
||||
if (context.Channel != null && context.Channel.State == CommunicationState.Opened)
|
||||
{
|
||||
context.Channel.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnClosed()
|
||||
{
|
||||
base.OnClosed();
|
||||
JavascriptObjectRepository = null;
|
||||
operationContextTaskCompletionSource = null;
|
||||
}
|
||||
|
||||
public static CustomBinding CreateBinding()
|
||||
|
||||
@@ -24,8 +24,5 @@ namespace CefSharp.Internals
|
||||
|
||||
[OperationContract]
|
||||
BrowserProcessResponse SetProperty(long objectId, string name, object value);
|
||||
|
||||
[OperationContract]
|
||||
void Connect();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user