blob: 03e02792b9c8457aaf085fe96933c96911fec6f4 [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "modules/push_messaging/PushEvent.h"
#include "modules/push_messaging/PushEventInit.h"
namespace blink {
PushEvent::PushEvent(const AtomicString& type,
PushMessageData* data,
WaitUntilObserver* observer)
: ExtendableEvent(type, ExtendableEventInit(), observer), data_(data) {}
PushEvent::PushEvent(const AtomicString& type, const PushEventInit& initializer)
: ExtendableEvent(type, initializer) {
if (initializer.hasData())
data_ = PushMessageData::Create(initializer.data());
}
PushEvent::~PushEvent() = default;
const AtomicString& PushEvent::InterfaceName() const {
return EventNames::PushEvent;
}
PushMessageData* PushEvent::data() {
return data_.Get();
}
void PushEvent::Trace(blink::Visitor* visitor) {
visitor->Trace(data_);
ExtendableEvent::Trace(visitor);
}
} // namespace blink