1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ApplicationCacheErrorEvent_h
6 #define ApplicationCacheErrorEvent_h
8 #include "core/events/Event.h"
9 #include "core/loader/appcache/ApplicationCacheHost.h"
10 #include "public/platform/WebApplicationCacheHostClient.h"
14 class ApplicationCacheErrorEvent;
16 struct ApplicationCacheErrorEventInit : public EventInit {
17 ApplicationCacheErrorEventInit();
25 class ApplicationCacheErrorEvent FINAL : public Event {
26 DEFINE_WRAPPERTYPEINFO();
28 virtual ~ApplicationCacheErrorEvent();
30 static PassRefPtrWillBeRawPtr<ApplicationCacheErrorEvent> create()
32 return adoptRefWillBeNoop(new ApplicationCacheErrorEvent);
35 static PassRefPtrWillBeRawPtr<ApplicationCacheErrorEvent> create(blink::WebApplicationCacheHost::ErrorReason reason, const String& url, int status, const String& message)
37 return adoptRefWillBeNoop(new ApplicationCacheErrorEvent(reason, url, status, message));
40 static PassRefPtrWillBeRawPtr<ApplicationCacheErrorEvent> create(const AtomicString& eventType, const ApplicationCacheErrorEventInit& initializer)
42 return adoptRefWillBeNoop(new ApplicationCacheErrorEvent(eventType, initializer));
45 const String& reason() const { return m_reason; }
46 const String& url() const { return m_url; }
47 int status() const { return m_status; }
48 const String& message() const { return m_message; }
50 virtual const AtomicString& interfaceName() const OVERRIDE { return EventNames::ApplicationCacheErrorEvent; }
52 virtual void trace(Visitor*) OVERRIDE;
55 ApplicationCacheErrorEvent();
56 ApplicationCacheErrorEvent(blink::WebApplicationCacheHost::ErrorReason, const String& url, int status, const String& message);
57 ApplicationCacheErrorEvent(const AtomicString& eventType, const ApplicationCacheErrorEventInit& initializer);
67 #endif // ApplicationCacheErrorEvent_h