Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/PlacesVisit.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 file,
5
 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef mozilla_dom_PlacesVisit_h
8
#define mozilla_dom_PlacesVisit_h
9
10
#include "mozilla/dom/PlacesEvent.h"
11
12
namespace mozilla {
13
namespace dom {
14
15
class PlacesVisit final : public PlacesEvent
16
{
17
public:
18
0
  explicit PlacesVisit() : PlacesEvent(PlacesEventType::Page_visited) {}
19
20
  static already_AddRefed<PlacesVisit>
21
  Constructor(const GlobalObject& aGlobal,
22
0
              ErrorResult& aRv) {
23
0
    RefPtr<PlacesVisit> event = new PlacesVisit();
24
0
    return event.forget();
25
0
  }
26
27
  JSObject*
28
  WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
29
0
  {
30
0
    return PlacesVisit_Binding::Wrap(aCx, this, aGivenProto);
31
0
  }
32
33
0
  const PlacesVisit* AsPlacesVisit() const override { return this; }
34
35
0
  void GetUrl(nsString& aUrl) { aUrl = mUrl; }
36
0
  uint64_t VisitId() { return mVisitId; }
37
0
  uint64_t VisitTime() { return mVisitTime; }
38
0
  uint64_t ReferringVisitId() { return mReferringVisitId; }
39
0
  uint64_t TransitionType() { return mTransitionType; }
40
0
  void GetPageGuid(nsTString<char>& aPageGuid) { aPageGuid = mPageGuid; }
41
0
  bool Hidden() { return mHidden; }
42
0
  uint32_t VisitCount() { return mVisitCount; }
43
0
  uint32_t TypedCount() { return mTypedCount; }
44
0
  void GetLastKnownTitle(nsString& aLastKnownTitle) { aLastKnownTitle = mLastKnownTitle; }
45
46
  // It's convenient for these to be directly available in C++, so just expose
47
  // them. These are generally passed around with const qualifiers anyway, so
48
  // it shouldn't be a problem.
49
  nsString mUrl;
50
  uint64_t mVisitId;
51
  uint64_t mVisitTime;
52
  uint64_t mReferringVisitId;
53
  uint32_t mTransitionType;
54
  nsCString mPageGuid;
55
  bool mHidden;
56
  uint32_t mVisitCount;
57
  uint32_t mTypedCount;
58
  nsString mLastKnownTitle;
59
60
private:
61
0
  ~PlacesVisit() = default;
62
};
63
64
} // namespace dom
65
} // namespace mozilla
66
67
#endif // mozilla_dom_PlacesVisit_h