Esempio n. 1
0
        private bool OnRuntimeMemoryAllocationChanging(IntPtr callbackState, JavaScriptMemoryEventType allocationEvent, UIntPtr allocationSize)
        {
            if (!IsDisposed && null != MemoryAllocationChanging)
            {
                lock (MemoryAllocationChanging)
                {
                    if (null != MemoryAllocationChanging)
                    {
                        var args = new JavaScriptMemoryEventArgs(allocationSize, allocationEvent);
                        MemoryAllocationChanging(this, args);
                        if (args.IsCancelable && args.Cancel)
                        {
                            return(false);
                        }
                    }
                }
            }

            return(true);
        }
Esempio n. 2
0
 public JavaScriptMemoryEventArgs(UIntPtr amount, JavaScriptMemoryEventType type)
 {
     Amount = amount;
     Type   = type;
 }