mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 12:09:40 +00:00
Merge remote-tracking branch 'remotes/upstream/master' into cef/2171
This commit is contained in:
@@ -8,6 +8,7 @@ using TaskExtensions = CefSharp.Internals.TaskExtensions;
|
||||
|
||||
namespace CefSharp.BrowserSubprocess
|
||||
{
|
||||
[CallbackBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]
|
||||
public class CefRenderProcess : CefSubProcess, IRenderProcess
|
||||
{
|
||||
private int? parentBrowserId;
|
||||
|
||||
@@ -471,7 +471,7 @@ namespace CefSharp.Wpf
|
||||
|
||||
private void CreateOffscreenBrowserWhenActualSizeChanged()
|
||||
{
|
||||
if (browserCreated)
|
||||
if (browserCreated || System.ComponentModel.DesignerProperties.GetIsInDesignMode(this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.ServiceModel;
|
||||
|
||||
namespace CefSharp.Internals
|
||||
{
|
||||
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
|
||||
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode=ConcurrencyMode.Multiple)]
|
||||
public class BrowserProcessService : IBrowserProcess
|
||||
{
|
||||
private readonly JavascriptObjectRepository javascriptObjectRepository;
|
||||
|
||||
@@ -60,6 +60,35 @@ namespace CefSharp.Internals
|
||||
}).Unwrap();
|
||||
}
|
||||
|
||||
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();
|
||||
@@ -75,6 +104,11 @@ namespace CefSharp.Internals
|
||||
binding.SendTimeout = TimeSpan.MaxValue;
|
||||
binding.OpenTimeout = TimeSpan.MaxValue;
|
||||
binding.CloseTimeout = TimeSpan.MaxValue;
|
||||
binding.ReaderQuotas.MaxStringContentLength = int.MaxValue;
|
||||
binding.ReaderQuotas.MaxArrayLength = int.MaxValue;
|
||||
binding.ReaderQuotas.MaxDepth = int.MaxValue;
|
||||
binding.ReaderQuotas.MaxNameTableCharCount = int.MaxValue;
|
||||
binding.ReaderQuotas.MaxBytesPerRead = int.MaxValue;
|
||||
|
||||
// Ensure binding connection stays open indefinitely until closed
|
||||
var customBinding = new CustomBinding(binding);
|
||||
|
||||
Reference in New Issue
Block a user