public void FinishTopLevelCallSafe(Call topLevelCall)
 {
     lock (m_EventsUnSafe)
     {
         // Careful here, calling "Safe" function which means another lock is being acquired inside the current lock.
         m_EventForCurrentTopLevelCall.AddTopLevelCallSafe(topLevelCall);
         m_EventForCurrentTopLevelCall = null;
     }
 }
Exemplo n.º 2
0
 public void AddTopLevelCallSafe(Call call)
 {
     lock (m_TopLevelCallsUnSafe)
     {
         var top = new TopLevelCall(call);
         m_TopLevelCallsUnSafe.Add(top);
         m_TopLevelCallsCountAll++;
         m_TopLevelCallsCountFiltered += top.HasFilteredVersion ? 1 : 0;
     }
 }
Exemplo n.º 3
0
 private void NotifyCallSiteChanged(Call callSite, int callSiteLine)
 {
     CallSite = callSite;
     CallSiteLine = callSiteLine;
 }
Exemplo n.º 4
0
 public int IndexOfSubCall(Call call)
 {
     return m_SubCalls.IndexOf(call);
 }
Exemplo n.º 5
0
        public Call FilterDojoJQuery(bool fromOk, Call parent)
        {
            bool ok = !IsDojoJQuery();

            Call c, p;
            if (ok)
            {
                c = this.Clone();
                p = c;
            }
            else if (fromOk)
            {
                c = this.Clone();
                p = null;
            }
            else if (parent == null)
            {
                c = this.Clone();
                c.IsFiltered = true;
                p = c;
            }
            else
            {
                c = parent;
                p = parent;
            }

            foreach (Call z in this.SubCalls.Select(call => call.FilterDojoJQuery(ok, p)).Where(call => call != null))
                if (c != z)
                    c.AddSubCall(z, c.IsFiltered ? -1 : z.CallSiteLine);

            if (c.IsFiltered && c.SubCallsCount == 0)
                return null;
            else
                return c;
        }
Exemplo n.º 6
0
 public Call Clone()
 {
     Call call = new Call(Script);
     call.CallSite = CallSite;
     call.CallSiteLine = CallSiteLine;
     call.ReturnLine = ReturnLine;
     call.IsFiltered = IsFiltered;
     call.Xhrs = Xhrs;
     call.IntervalTimeouts = IntervalTimeouts;
     call.XhrInfo = XhrInfo;
     call.IntervalTimeoutInfo = IntervalTimeoutInfo;
     return call;
 }
Exemplo n.º 7
0
 public void AddSubCall(Call call, int callSiteLine)
 {
     m_SubCalls.Add(call);
     call.NotifyCallSiteChanged(this, callSiteLine);
 }
Exemplo n.º 8
0
 public static Call CreateTopLevel(Script script)
 {
     Call call = new Call(script);
     call.Xhrs = new List<Xhr>();
     call.IntervalTimeouts = new List<IntervalTimeout>();
     return call;
 }
Exemplo n.º 9
0
 public void SetSend(Call call)
 {
     XhrEvents.Add(new XhrEvent() { Type = XhrEventType.Send, Call = call });
 }
Exemplo n.º 10
0
 public void AddEval(Call call)
 {
     XhrEvents.Add(new XhrEvent() { Type = XhrEventType.Eval, Call = call });
 }
Exemplo n.º 11
0
 public void AddAccess(Call call)
 {
     // Prevent duplicate adds (simple, but good enough)
     if (XhrEvents.Where(xe => xe.Type == XhrEventType.Access).Select(xe => xe.Call).LastOrDefault() != call)
         XhrEvents.Add(new XhrEvent() { Type = XhrEventType.Access, Call = call });
 }
 public TopLevelCall(Call root)
 {
     Root = root;
     FilteredRoot = root.FilterDojoJQuery(false, null);
 }