Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "txForwardContext.h"
7 #include "txNodeSet.h"
9 const txXPathNode& txForwardContext::getContextNode()
10 {
11 return mContextNode;
12 }
14 uint32_t txForwardContext::size()
15 {
16 return (uint32_t)mContextSet->size();
17 }
19 uint32_t txForwardContext::position()
20 {
21 int32_t pos = mContextSet->indexOf(mContextNode);
22 NS_ASSERTION(pos >= 0, "Context is not member of context node list.");
23 return (uint32_t)(pos + 1);
24 }
26 nsresult txForwardContext::getVariable(int32_t aNamespace, nsIAtom* aLName,
27 txAExprResult*& aResult)
28 {
29 NS_ASSERTION(mInner, "mInner is null!!!");
30 return mInner->getVariable(aNamespace, aLName, aResult);
31 }
33 bool txForwardContext::isStripSpaceAllowed(const txXPathNode& aNode)
34 {
35 NS_ASSERTION(mInner, "mInner is null!!!");
36 return mInner->isStripSpaceAllowed(aNode);
37 }
39 void* txForwardContext::getPrivateContext()
40 {
41 NS_ASSERTION(mInner, "mInner is null!!!");
42 return mInner->getPrivateContext();
43 }
45 txResultRecycler* txForwardContext::recycler()
46 {
47 NS_ASSERTION(mInner, "mInner is null!!!");
48 return mInner->recycler();
49 }
51 void txForwardContext::receiveError(const nsAString& aMsg, nsresult aRes)
52 {
53 NS_ASSERTION(mInner, "mInner is null!!!");
54 #ifdef DEBUG
55 nsAutoString error(NS_LITERAL_STRING("forwarded error: "));
56 error.Append(aMsg);
57 mInner->receiveError(error, aRes);
58 #else
59 mInner->receiveError(aMsg, aRes);
60 #endif
61 }