Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/PrecompiledScript.h
Line
Count
Source (jump to first uncovered line)
1
/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
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/. */
5
6
#ifndef mozilla_dom_PrecompiledScript_h
7
#define mozilla_dom_PrecompiledScript_h
8
9
#include "mozilla/dom/BindingDeclarations.h"
10
#include "mozilla/dom/PrecompiledScriptBinding.h"
11
12
#include "jsapi.h"
13
14
#include "nsCOMPtr.h"
15
#include "nsCycleCollectionParticipant.h"
16
#include "nsISupports.h"
17
#include "nsWrapperCache.h"
18
19
namespace mozilla {
20
namespace dom {
21
class PrecompiledScript : public nsISupports
22
                        , public nsWrapperCache
23
{
24
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
25
  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(PrecompiledScript)
26
27
  explicit PrecompiledScript(nsISupports* aParent, JS::Handle<JSScript*> aScript, JS::ReadOnlyCompileOptions& aOptions);
28
29
  void ExecuteInGlobal(JSContext* aCx, JS::HandleObject aGlobal,
30
                       JS::MutableHandleValue aRval,
31
                       ErrorResult& aRv);
32
33
  void GetUrl(nsAString& aUrl);
34
35
  bool HasReturnValue();
36
37
0
  nsISupports* GetParentObject() const { return mParent; }
38
39
  virtual JSObject* WrapObject(JSContext* aCx,
40
                               JS::Handle<JSObject*> aGivenProto) override;
41
42
protected:
43
  virtual ~PrecompiledScript();
44
45
private:
46
  bool IsBlackForCC(bool aTracingNeeded);
47
48
  nsCOMPtr<nsISupports> mParent;
49
50
  JS::Heap<JSScript*> mScript;
51
  nsCString mURL;
52
  const bool mHasReturnValue;
53
};
54
55
} // namespace dom
56
} // namespace mozilla
57
58
#endif // mozilla_dom_PrecompiledScript_h