OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "JSDOMWindowShell.h" | 32 #include "JSDOMWindowShell.h" |
33 #include "JSEventListener.h" | 33 #include "JSEventListener.h" |
34 #include "JSMessagePort.h" | 34 #include "JSMessagePort.h" |
35 #include "JSNode.h" | 35 #include "JSNode.h" |
36 #include "JSXMLHttpRequest.h" | 36 #include "JSXMLHttpRequest.h" |
37 #include "JSXMLHttpRequestUpload.h" | 37 #include "JSXMLHttpRequestUpload.h" |
38 #include "MessagePort.h" | 38 #include "MessagePort.h" |
39 #include "XMLHttpRequest.h" | 39 #include "XMLHttpRequest.h" |
40 #include "XMLHttpRequestUpload.h" | 40 #include "XMLHttpRequestUpload.h" |
41 | 41 |
42 #if ENABLE(OFFLINE_WEB_APPLICATIONS) | 42 #if ENABLE(OFFLINE_WEB_APPLICATIONS) || ENABLE(APPLICATION_CACHE) |
43 #include "DOMApplicationCache.h" | 43 #include "DOMApplicationCache.h" |
44 #include "JSDOMApplicationCache.h" | 44 #include "JSDOMApplicationCache.h" |
45 #endif | 45 #endif |
46 | 46 |
47 #if ENABLE(SVG) | 47 #if ENABLE(SVG) |
48 #include "SVGElementInstance.h" | 48 #include "SVGElementInstance.h" |
49 #include "JSSVGElementInstance.h" | 49 #include "JSSVGElementInstance.h" |
50 #endif | 50 #endif |
51 | 51 |
52 #if ENABLE(WORKERS) | 52 #if ENABLE(WORKERS) |
(...skipping 24 matching lines...) Expand all Loading... |
77 if (DOMWindow* domWindow = target->toDOMWindow()) | 77 if (DOMWindow* domWindow = target->toDOMWindow()) |
78 return toJS(exec, domWindow); | 78 return toJS(exec, domWindow); |
79 | 79 |
80 if (XMLHttpRequest* xhr = target->toXMLHttpRequest()) | 80 if (XMLHttpRequest* xhr = target->toXMLHttpRequest()) |
81 // XMLHttpRequest is always created via JS, so we don't need to use cach
eDOMObject() here. | 81 // XMLHttpRequest is always created via JS, so we don't need to use cach
eDOMObject() here. |
82 return getCachedDOMObjectWrapper(exec->globalData(), xhr); | 82 return getCachedDOMObjectWrapper(exec->globalData(), xhr); |
83 | 83 |
84 if (XMLHttpRequestUpload* upload = target->toXMLHttpRequestUpload()) | 84 if (XMLHttpRequestUpload* upload = target->toXMLHttpRequestUpload()) |
85 return toJS(exec, upload); | 85 return toJS(exec, upload); |
86 | 86 |
87 #if ENABLE(OFFLINE_WEB_APPLICATIONS) | 87 #if ENABLE(OFFLINE_WEB_APPLICATIONS) || ENABLE(APPLICATION_CACHE) |
88 if (DOMApplicationCache* cache = target->toDOMApplicationCache()) | 88 if (DOMApplicationCache* cache = target->toDOMApplicationCache()) |
89 // DOMApplicationCache is always created via JS, so we don't need to use
cacheDOMObject() here. | 89 // DOMApplicationCache is always created via JS, so we don't need to use
cacheDOMObject() here. |
90 return getCachedDOMObjectWrapper(exec->globalData(), cache); | 90 return getCachedDOMObjectWrapper(exec->globalData(), cache); |
91 #endif | 91 #endif |
92 | 92 |
93 if (MessagePort* messagePort = target->toMessagePort()) | 93 if (MessagePort* messagePort = target->toMessagePort()) |
94 return toJS(exec, messagePort); | 94 return toJS(exec, messagePort); |
95 | 95 |
96 #if ENABLE(WORKERS) | 96 #if ENABLE(WORKERS) |
97 if (Worker* worker = target->toWorker()) | 97 if (Worker* worker = target->toWorker()) |
(...skipping 14 matching lines...) Expand all Loading... |
112 return static_cast<JS##type*>(asObject(value))->impl(); | 112 return static_cast<JS##type*>(asObject(value))->impl(); |
113 | 113 |
114 CONVERT_TO_EVENT_TARGET(Node) | 114 CONVERT_TO_EVENT_TARGET(Node) |
115 CONVERT_TO_EVENT_TARGET(XMLHttpRequest) | 115 CONVERT_TO_EVENT_TARGET(XMLHttpRequest) |
116 CONVERT_TO_EVENT_TARGET(XMLHttpRequestUpload) | 116 CONVERT_TO_EVENT_TARGET(XMLHttpRequestUpload) |
117 CONVERT_TO_EVENT_TARGET(MessagePort) | 117 CONVERT_TO_EVENT_TARGET(MessagePort) |
118 | 118 |
119 if (value.isObject(&JSDOMWindowShell::s_info)) | 119 if (value.isObject(&JSDOMWindowShell::s_info)) |
120 return static_cast<JSDOMWindowShell*>(asObject(value))->impl(); | 120 return static_cast<JSDOMWindowShell*>(asObject(value))->impl(); |
121 | 121 |
122 #if ENABLE(OFFLINE_WEB_APPLICATIONS) | 122 #if ENABLE(OFFLINE_WEB_APPLICATIONS) || ENABLE(APPLICATION_CACHE) |
123 CONVERT_TO_EVENT_TARGET(DOMApplicationCache) | 123 CONVERT_TO_EVENT_TARGET(DOMApplicationCache) |
124 #endif | 124 #endif |
125 | 125 |
126 #if ENABLE(SVG) | 126 #if ENABLE(SVG) |
127 CONVERT_TO_EVENT_TARGET(SVGElementInstance) | 127 CONVERT_TO_EVENT_TARGET(SVGElementInstance) |
128 #endif | 128 #endif |
129 | 129 |
130 #if ENABLE(WORKERS) | 130 #if ENABLE(WORKERS) |
131 CONVERT_TO_EVENT_TARGET(Worker) | 131 CONVERT_TO_EVENT_TARGET(Worker) |
132 CONVERT_TO_EVENT_TARGET(WorkerContext) | 132 CONVERT_TO_EVENT_TARGET(WorkerContext) |
133 #endif | 133 #endif |
134 | 134 |
135 return 0; | 135 return 0; |
136 } | 136 } |
137 | 137 |
138 } // namespace WebCore | 138 } // namespace WebCore |
OLD | NEW |