Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: Source/core/events/SecurityPolicyViolationEvent.h

Issue 26558004: Revert 158219 "Move dom/*Event* to events to match the DOM vs. E..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1651/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN Y
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN Y
17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O N
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25 #ifndef SecurityPolicyViolationEvent_h
26 #define SecurityPolicyViolationEvent_h
27
28 #include "core/events/Event.h"
29 #include "core/events/EventNames.h"
30
31 namespace WebCore {
32
33 struct SecurityPolicyViolationEventInit : public EventInit {
34 SecurityPolicyViolationEventInit()
35 {
36 }
37
38 String documentURI;
39 String referrer;
40 String blockedURI;
41 String violatedDirective;
42 String effectiveDirective;
43 String originalPolicy;
44 String sourceFile;
45 int lineNumber;
46 int columnNumber;
47 int statusCode;
48 };
49
50 class SecurityPolicyViolationEvent : public Event {
51 public:
52 static PassRefPtr<SecurityPolicyViolationEvent> create()
53 {
54 return adoptRef(new SecurityPolicyViolationEvent());
55 }
56
57 static PassRefPtr<SecurityPolicyViolationEvent> create(const AtomicString& t ype, const SecurityPolicyViolationEventInit& initializer)
58 {
59 return adoptRef(new SecurityPolicyViolationEvent(type, initializer));
60 }
61
62 const String& documentURI() const { return m_documentURI; }
63 const String& referrer() const { return m_referrer; }
64 const String& blockedURI() const { return m_blockedURI; }
65 const String& violatedDirective() const { return m_violatedDirective; }
66 const String& effectiveDirective() const { return m_effectiveDirective; }
67 const String& originalPolicy() const { return m_originalPolicy; }
68 const String& sourceFile() const { return m_sourceFile; }
69 int lineNumber() const { return m_lineNumber; }
70 int columnNumber() const { return m_columnNumber; }
71 int statusCode() const { return m_statusCode; }
72
73 virtual const AtomicString& interfaceName() const { return eventNames().inte rfaceForSecurityPolicyViolationEvent; }
74
75 private:
76 SecurityPolicyViolationEvent()
77 {
78 ScriptWrappable::init(this);
79 }
80
81 SecurityPolicyViolationEvent(const AtomicString& type, const SecurityPolicyV iolationEventInit& initializer)
82 : Event(type, initializer)
83 , m_documentURI(initializer.documentURI)
84 , m_referrer(initializer.referrer)
85 , m_blockedURI(initializer.blockedURI)
86 , m_violatedDirective(initializer.violatedDirective)
87 , m_effectiveDirective(initializer.effectiveDirective)
88 , m_originalPolicy(initializer.originalPolicy)
89 , m_sourceFile(initializer.sourceFile)
90 , m_lineNumber(initializer.lineNumber)
91 , m_columnNumber(initializer.columnNumber)
92 , m_statusCode(initializer.statusCode)
93 {
94 ScriptWrappable::init(this);
95 }
96
97 String m_documentURI;
98 String m_referrer;
99 String m_blockedURI;
100 String m_violatedDirective;
101 String m_effectiveDirective;
102 String m_originalPolicy;
103 String m_sourceFile;
104 int m_lineNumber;
105 int m_columnNumber;
106 int m_statusCode;
107 };
108
109 } // namespace WebCore
110
111 #endif // SecurityPolicyViolationEvent_h
OLDNEW
« no previous file with comments | « Source/core/events/ScopedEventQueue.cpp ('k') | Source/core/events/SecurityPolicyViolationEvent.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698