Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/xbl/nsXBLProtoImplField.h
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef nsXBLProtoImplField_h__
8
#define nsXBLProtoImplField_h__
9
10
#include "nsAtom.h"
11
#include "nsString.h"
12
#include "jsapi.h"
13
#include "nsString.h"
14
#include "nsXBLProtoImplMember.h"
15
16
class nsIObjectInputStream;
17
class nsIObjectOutputStream;
18
class nsIURI;
19
20
class nsXBLProtoImplField
21
{
22
public:
23
  nsXBLProtoImplField(const char16_t* aName, const char16_t* aReadOnly);
24
  explicit nsXBLProtoImplField(const bool aIsReadOnly);
25
  ~nsXBLProtoImplField();
26
27
  void AppendFieldText(const nsAString& aText);
28
0
  void SetLineNumber(uint32_t aLineNumber) {
29
0
    mLineNumber = aLineNumber;
30
0
  }
31
32
0
  nsXBLProtoImplField* GetNext() const { return mNext; }
33
0
  void SetNext(nsXBLProtoImplField* aNext) { mNext = aNext; }
34
35
  nsresult InstallField(JS::Handle<JSObject*> aBoundNode,
36
                        const nsXBLPrototypeBinding& aProtoBinding,
37
                        bool* aDidInstall) const;
38
39
  nsresult InstallAccessors(JSContext* aCx,
40
                            JS::Handle<JSObject*> aTargetClassObject);
41
42
  nsresult Read(nsIObjectInputStream* aStream);
43
  nsresult Write(nsIObjectOutputStream* aStream);
44
45
0
  const char16_t* GetName() const { return mName; }
46
47
0
  unsigned AccessorAttributes() const {
48
0
    return JSPROP_GETTER | JSPROP_SETTER |
49
0
           (mJSAttributes & (JSPROP_ENUMERATE | JSPROP_PERMANENT));
50
0
  }
51
52
0
  bool IsEmpty() const { return mFieldTextLength == 0; }
53
54
protected:
55
  nsXBLProtoImplField* mNext;
56
  char16_t* mName;
57
  char16_t* mFieldText;
58
  uint32_t mFieldTextLength;
59
  uint32_t mLineNumber;
60
  unsigned mJSAttributes;
61
};
62
63
#endif // nsXBLProtoImplField_h__