OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 enum PageshowEventPersistence { | 57 enum PageshowEventPersistence { |
58 PageshowEventNotPersisted = 0, | 58 PageshowEventNotPersisted = 0, |
59 PageshowEventPersisted = 1 | 59 PageshowEventPersisted = 1 |
60 }; | 60 }; |
61 | 61 |
62 enum SetLocationLocking { LockHistoryBasedOnGestureState, LockHistoryAndBackForw
ardList }; | 62 enum SetLocationLocking { LockHistoryBasedOnGestureState, LockHistoryAndBackForw
ardList }; |
63 | 63 |
64 // Note: if you're thinking of returning something DOM-related by reference, | 64 // Note: if you're thinking of returning something DOM-related by reference, |
65 // please ping dcheng@chromium.org first. You probably don't want to do that. | 65 // please ping dcheng@chromium.org first. You probably don't want to do that. |
66 class LocalDOMWindow final : public DOMWindow, public WillBeHeapSupplementable<L
ocalDOMWindow>, public LifecycleContext<LocalDOMWindow> { | 66 class LocalDOMWindow final : public DOMWindow, public WillBeHeapSupplementable<L
ocalDOMWindow>, public LifecycleContext<LocalDOMWindow> { |
67 DEFINE_WRAPPERTYPEINFO(); | |
68 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LocalDOMWindow); | 67 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LocalDOMWindow); |
69 public: | 68 public: |
70 static PassRefPtrWillBeRawPtr<Document> createDocument(const String& mimeTyp
e, const DocumentInit&, bool forceXHTML); | 69 static PassRefPtrWillBeRawPtr<Document> createDocument(const String& mimeTyp
e, const DocumentInit&, bool forceXHTML); |
71 static PassRefPtrWillBeRawPtr<LocalDOMWindow> create(LocalFrame& frame) | 70 static PassRefPtrWillBeRawPtr<LocalDOMWindow> create(LocalFrame& frame) |
72 { | 71 { |
73 return adoptRefWillBeNoop(new LocalDOMWindow(frame)); | 72 return adoptRefWillBeNoop(new LocalDOMWindow(frame)); |
74 } | 73 } |
75 virtual ~LocalDOMWindow(); | 74 virtual ~LocalDOMWindow(); |
76 | 75 |
77 PassRefPtrWillBeRawPtr<Document> installNewDocument(const String& mimeType,
const DocumentInit&, bool forceXHTML = false); | 76 PassRefPtrWillBeRawPtr<Document> installNewDocument(const String& mimeType,
const DocumentInit&, bool forceXHTML = false); |
(...skipping 27 matching lines...) Expand all Loading... |
105 double scrollX() const override; | 104 double scrollX() const override; |
106 double scrollY() const override; | 105 double scrollY() const override; |
107 bool closed() const override; | 106 bool closed() const override; |
108 unsigned length() const override; | 107 unsigned length() const override; |
109 const AtomicString& name() const override; | 108 const AtomicString& name() const override; |
110 void setName(const AtomicString&) override; | 109 void setName(const AtomicString&) override; |
111 String status() const override; | 110 String status() const override; |
112 void setStatus(const String&) override; | 111 void setStatus(const String&) override; |
113 String defaultStatus() const override; | 112 String defaultStatus() const override; |
114 void setDefaultStatus(const String&) override; | 113 void setDefaultStatus(const String&) override; |
115 LocalDOMWindow* self() const override; | 114 DOMWindow* self() const override; |
116 LocalDOMWindow* window() const { return self(); } | 115 DOMWindow* window() const { return self(); } |
117 LocalDOMWindow* frames() const { return self(); } | 116 DOMWindow* frames() const { return self(); } |
118 LocalDOMWindow* opener() const override; | 117 DOMWindow* opener() const override; |
119 LocalDOMWindow* parent() const override; | 118 DOMWindow* parent() const override; |
120 LocalDOMWindow* top() const override; | 119 DOMWindow* top() const override; |
121 Document* document() const override; | 120 Document* document() const override; |
122 StyleMedia* styleMedia() const override; | 121 StyleMedia* styleMedia() const override; |
123 double devicePixelRatio() const override; | 122 double devicePixelRatio() const override; |
124 Storage* sessionStorage(ExceptionState&) const override; | 123 Storage* sessionStorage(ExceptionState&) const override; |
125 Storage* localStorage(ExceptionState&) const override; | 124 Storage* localStorage(ExceptionState&) const override; |
126 ApplicationCache* applicationCache() const override; | 125 ApplicationCache* applicationCache() const override; |
127 int orientation() const override; | 126 int orientation() const override; |
128 Console* console() const override; | 127 Console* console() const override; |
129 Performance* performance() const override; | 128 Performance* performance() const override; |
130 DOMWindowCSS* css() const override; | 129 DOMWindowCSS* css() const override; |
(...skipping 14 matching lines...) Expand all Loading... |
145 void moveBy(float x, float y) const override; | 144 void moveBy(float x, float y) const override; |
146 void moveTo(float x, float y) const override; | 145 void moveTo(float x, float y) const override; |
147 void resizeBy(float x, float y) const override; | 146 void resizeBy(float x, float y) const override; |
148 void resizeTo(float width, float height) const override; | 147 void resizeTo(float width, float height) const override; |
149 PassRefPtrWillBeRawPtr<MediaQueryList> matchMedia(const String&) override; | 148 PassRefPtrWillBeRawPtr<MediaQueryList> matchMedia(const String&) override; |
150 PassRefPtrWillBeRawPtr<CSSStyleDeclaration> getComputedStyle(Element*, const
String& pseudoElt) const override; | 149 PassRefPtrWillBeRawPtr<CSSStyleDeclaration> getComputedStyle(Element*, const
String& pseudoElt) const override; |
151 PassRefPtrWillBeRawPtr<CSSRuleList> getMatchedCSSRules(Element*, const Strin
g& pseudoElt) const override; | 150 PassRefPtrWillBeRawPtr<CSSRuleList> getMatchedCSSRules(Element*, const Strin
g& pseudoElt) const override; |
152 int requestAnimationFrame(RequestAnimationFrameCallback*) override; | 151 int requestAnimationFrame(RequestAnimationFrameCallback*) override; |
153 int webkitRequestAnimationFrame(RequestAnimationFrameCallback*) override; | 152 int webkitRequestAnimationFrame(RequestAnimationFrameCallback*) override; |
154 void cancelAnimationFrame(int id) override; | 153 void cancelAnimationFrame(int id) override; |
155 LocalDOMWindow* anonymousIndexedGetter(uint32_t) override; | 154 DOMWindow* anonymousIndexedGetter(uint32_t) override; |
156 void postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePor
tArray*, const String& targetOrigin, LocalDOMWindow* source, ExceptionState&) ov
erride; | 155 void postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePor
tArray*, const String& targetOrigin, LocalDOMWindow* source, ExceptionState&) ov
erride; |
| 156 String crossDomainAccessErrorMessage(LocalDOMWindow* callingWindow) override
; |
| 157 String sanitizedCrossDomainAccessErrorMessage(LocalDOMWindow* callingWindow)
override; |
157 | 158 |
158 void registerProperty(DOMWindowProperty*); | 159 void registerProperty(DOMWindowProperty*); |
159 void unregisterProperty(DOMWindowProperty*); | 160 void unregisterProperty(DOMWindowProperty*); |
160 | 161 |
161 void reset(); | 162 void reset(); |
162 | 163 |
163 unsigned pendingUnloadEventListeners() const; | 164 unsigned pendingUnloadEventListeners() const; |
164 | 165 |
165 static FloatRect adjustWindowRect(LocalFrame&, const FloatRect& pendingChang
es); | 166 static FloatRect adjustWindowRect(LocalFrame&, const FloatRect& pendingChang
es); |
166 | 167 |
(...skipping 10 matching lines...) Expand all Loading... |
177 PassRefPtrWillBeRawPtr<LocalDOMWindow> open(const String& urlString, const A
tomicString& frameName, const String& windowFeaturesString, | 178 PassRefPtrWillBeRawPtr<LocalDOMWindow> open(const String& urlString, const A
tomicString& frameName, const String& windowFeaturesString, |
178 LocalDOMWindow* callingWindow, LocalDOMWindow* enteredWindow); | 179 LocalDOMWindow* callingWindow, LocalDOMWindow* enteredWindow); |
179 | 180 |
180 typedef void (*PrepareDialogFunction)(LocalDOMWindow*, void* context); | 181 typedef void (*PrepareDialogFunction)(LocalDOMWindow*, void* context); |
181 void showModalDialog(const String& urlString, const String& dialogFeaturesSt
ring, | 182 void showModalDialog(const String& urlString, const String& dialogFeaturesSt
ring, |
182 LocalDOMWindow* callingWindow, LocalDOMWindow* enteredWindow, PrepareDia
logFunction, void* functionContext); | 183 LocalDOMWindow* callingWindow, LocalDOMWindow* enteredWindow, PrepareDia
logFunction, void* functionContext); |
183 | 184 |
184 FrameConsole* frameConsole() const; | 185 FrameConsole* frameConsole() const; |
185 | 186 |
186 void printErrorMessage(const String&); | 187 void printErrorMessage(const String&); |
187 String crossDomainAccessErrorMessage(LocalDOMWindow* callingWindow); | |
188 String sanitizedCrossDomainAccessErrorMessage(LocalDOMWindow* callingWindow)
; | |
189 | 188 |
190 void postMessageTimerFired(PostMessageTimer*); | 189 void postMessageTimerFired(PostMessageTimer*); |
191 void dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTargetOrigi
n, PassRefPtrWillBeRawPtr<Event>, PassRefPtrWillBeRawPtr<ScriptCallStack>); | 190 void dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTargetOrigi
n, PassRefPtrWillBeRawPtr<Event>, PassRefPtrWillBeRawPtr<ScriptCallStack>); |
192 | 191 |
193 // Events | 192 // Events |
194 // EventTarget API | 193 // EventTarget API |
195 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture = false) override; | 194 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture = false) override; |
196 virtual bool removeEventListener(const AtomicString& eventType, PassRefPtr<E
ventListener>, bool useCapture = false) override; | 195 virtual bool removeEventListener(const AtomicString& eventType, PassRefPtr<E
ventListener>, bool useCapture = false) override; |
197 virtual void removeAllEventListeners() override; | 196 virtual void removeAllEventListeners() override; |
198 | 197 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 } | 337 } |
339 | 338 |
340 inline String LocalDOMWindow::defaultStatus() const | 339 inline String LocalDOMWindow::defaultStatus() const |
341 { | 340 { |
342 return m_defaultStatus; | 341 return m_defaultStatus; |
343 } | 342 } |
344 | 343 |
345 } // namespace blink | 344 } // namespace blink |
346 | 345 |
347 #endif // LocalDOMWindow_h | 346 #endif // LocalDOMWindow_h |
OLD | NEW |