Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Private Member Functions
nsXBLBindingRequest Class Reference
Collaboration diagram for nsXBLBindingRequest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void DocumentLoaded (nsIDocument *aBindingDoc)

Static Public Member Functions

static nsXBLBindingRequestCreate (nsFixedSizeAllocator &aPool, nsIURL *aURL, nsIContent *aBoundElement)
static void Destroy (nsFixedSizeAllocator &aPool, nsXBLBindingRequest *aRequest)

Public Attributes

nsCOMPtr< nsIURLmBindingURL
nsCOMPtr< nsIContentmBoundElement

Static Public Attributes

static nsIXBLServicegXBLService = nsnull
static int gRefCnt = 0

Protected Member Functions

 nsXBLBindingRequest (nsIURL *aURL, nsIContent *aBoundElement)
 ~nsXBLBindingRequest ()

Static Private Member Functions

static voidoperator new (size_t) CPP_THROW_NEW
static void operator delete (void *, size_t)

Detailed Description

Definition at line 109 of file nsXBLService.cpp.


Constructor & Destructor Documentation

nsXBLBindingRequest::nsXBLBindingRequest ( nsIURL aURL,
nsIContent aBoundElement 
) [inline, protected]

Definition at line 182 of file nsXBLService.cpp.

    : mBindingURL(aURL),
      mBoundElement(aBoundElement)
  {
    gRefCnt++;
    if (gRefCnt == 1) {
      CallGetService("@mozilla.org/xbl;1", &gXBLService);
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 192 of file nsXBLService.cpp.

  {
    gRefCnt--;
    if (gRefCnt == 0) {
      NS_IF_RELEASE(gXBLService);
    }
  }

Here is the caller graph for this function:


Member Function Documentation

static nsXBLBindingRequest* nsXBLBindingRequest::Create ( nsFixedSizeAllocator &  aPool,
nsIURL aURL,
nsIContent aBoundElement 
) [inline, static]

Definition at line 116 of file nsXBLService.cpp.

                                                                               {
    void* place = aPool.Alloc(sizeof(nsXBLBindingRequest));
    return place ? ::new (place) nsXBLBindingRequest(aURL, aBoundElement) : nsnull;
  }

Here is the call graph for this function:

static void nsXBLBindingRequest::Destroy ( nsFixedSizeAllocator &  aPool,
nsXBLBindingRequest aRequest 
) [inline, static]

Definition at line 122 of file nsXBLService.cpp.

                                                                      {
    aRequest->~nsXBLBindingRequest();
    aPool.Free(aRequest, sizeof(*aRequest));
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 127 of file nsXBLService.cpp.

  {
    // We only need the document here to cause frame construction, so
    // we need the current doc, not the owner doc.
    nsIDocument* doc = mBoundElement->GetCurrentDoc();
    if (!doc)
      return;

    // Get the binding.
    PRBool ready = PR_FALSE;
    gXBLService->BindingReady(mBoundElement, mBindingURL, &ready);

    if (!ready)
      return;

    // XXX Deal with layered bindings.  For example, mBoundElement may be anonymous content.
    // Now do a ContentInserted notification to cause the frames to get installed finally,
    nsIContent* parent = mBoundElement->GetParent();
    PRInt32 index = 0;
    if (parent)
      index = parent->IndexOf(mBoundElement);
        
    // If |mBoundElement| is (in addition to having binding |mBinding|)
    // also a descendant of another element with binding |mBinding|,
    // then we might have just constructed it due to the
    // notification of its parent.  (We can know about both if the
    // binding loads were triggered from the DOM rather than frame
    // construction.)  So we have to check both whether the element
    // has a primary frame and whether it's in the undisplayed map
    // before sending a ContentInserted notification, or bad things
    // will happen.
    nsIPresShell *shell = doc->GetShellAt(0);
    if (shell) {
      nsIFrame* childFrame;
      shell->GetPrimaryFrameFor(mBoundElement, &childFrame);
      if (!childFrame) {
        // Check to see if it's in the undisplayed content map.
        nsStyleContext* sc =
          shell->FrameManager()->GetUndisplayedContent(mBoundElement);

        if (!sc) {
          nsCOMPtr<nsIDocumentObserver> obs(do_QueryInterface(shell));
          nsCOMPtr<nsIDocument> doc = shell->GetDocument();
          obs->BeginUpdate(doc, UPDATE_CONTENT_MODEL);
          obs->ContentInserted(doc, parent, mBoundElement, index);
          obs->EndUpdate(doc, UPDATE_CONTENT_MODEL);
        }
      }
    }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static void nsXBLBindingRequest::operator delete ( void ,
size_t   
) [inline, static, private]

Definition at line 204 of file nsXBLService.cpp.

{}
static void* nsXBLBindingRequest::operator new ( size_t  ) [inline, static, private]

Definition at line 203 of file nsXBLService.cpp.

{ return 0; }

Member Data Documentation

Definition at line 179 of file nsXBLService.cpp.

Definition at line 178 of file nsXBLService.cpp.

Definition at line 112 of file nsXBLService.cpp.

Definition at line 113 of file nsXBLService.cpp.


The documentation for this class was generated from the following file: