Changeset 34143 in webkit
- Timestamp:
- May 26, 2008 7:10:23 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r34136 r34143 1 2008-05-26 Maciej Stachowiak <mjs@apple.com> 2 3 Reviewed by Anders. 4 5 - make addStaticGlobals protected instead of private so subclasses can use it 6 7 * JavaScriptCore.exp: 8 * kjs/JSGlobalObject.h: 9 1 10 2008-05-26 Geoffrey Garen <ggaren@apple.com> 2 11 -
trunk/JavaScriptCore/JavaScriptCore.exp
r34088 r34143 110 110 __ZN3KJS12DateInstance4infoE 111 111 __ZN3KJS12PropertySlot15undefinedGetterEPNS_9ExecStateEPNS_8JSObjectERKNS_10IdentifierERKS0_ 112 __ZN3KJS12RegisterFile14addGlobalSlotsEm 112 113 __ZN3KJS13ArrayInstance4infoE 113 114 __ZN3KJS13CodeGenerator21setDumpsGeneratedCodeEb -
trunk/JavaScriptCore/kjs/JSGlobalObject.h
r34042 r34143 265 265 static ThreadClassInfoHashTables* threadClassInfoHashTables(); 266 266 267 private:268 267 void init(JSObject* thisValue); 269 268 270 269 JSGlobalObjectData* d() const { return static_cast<JSGlobalObjectData*>(JSVariableObject::d); } 271 270 271 protected: 272 272 struct GlobalPropertyInfo { 273 273 GlobalPropertyInfo(const Identifier& i, JSValue* v, unsigned a) … … 284 284 void addStaticGlobals(GlobalPropertyInfo*, int count); 285 285 286 private: 286 287 bool checkTimeout(); 287 288 void resetTimeoutCheck(); -
trunk/LayoutTests/ChangeLog
r34142 r34143 1 2008-05-26 Maciej Stachowiak <mjs@apple.com> 2 3 Reviewed by Anders. 4 5 - update test result for document/window being allocated to var slots 6 7 * http/tests/security/cross-frame-access-put-expected.txt: 8 1 9 2008-05-26 James Ren <jamesjren@gmail.com> 2 10 -
trunk/LayoutTests/http/tests/security/cross-frame-access-put-expected.txt
r29820 r34143 1 1 CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://127.0.0.1:8000/security/cross-frame-access-put.html from frame with URL http://localhost:8000/security/resources/cross-frame-iframe-for-put-test.html. Domains, protocols and ports must match. 2 3 CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe-for-put-test.html from frame with URL http://127.0.0.1:8000/security/cross-frame-access-put.html. Domains, protocols and ports must match. 2 4 3 5 CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe-for-put-test.html from frame with URL http://127.0.0.1:8000/security/cross-frame-access-put.html. Domains, protocols and ports must match. -
trunk/WebCore/ChangeLog
r34141 r34143 1 2008-05-25 Maciej Stachowiak <mjs@apple.com> 2 3 Reviewed by Anders. 4 5 - bind the window's "document" and "window" properties to static slots 6 1.7% speedup on Acid3 test 26 7 8 Only the "document" part matters for Acid3, but since I was doing 9 this anyway, "window" also seemed like a good one to optimize. 10 11 * bindings/js/JSDOMWindowBase.cpp: 12 (WebCore::JSDOMWindowBase::JSDOMWindowBase): Allocate variable 13 slots for document and window; but just put null in the document 14 slot for now. 15 (WebCore::JSDOMWindowBase::updateDocument): Fill in the document 16 slot. 17 (WebCore::JSDOMWindowBase::~JSDOMWindowBase): Make our shell stop 18 tracking us. 19 * bindings/js/JSDOMWindowBase.h: 20 * bindings/js/JSDOMWindowShell.cpp: 21 (WebCore::JSDOMWindowShell::JSDOMWindowShell): Allocate HashSet 22 for our still-not-dead inner windows. 23 (WebCore::JSDOMWindowShell::updateDocument): Update all our 24 inner windows ever (to make sure the update to the document 25 property shows up everywhere). 26 * bindings/js/JSDOMWindowShell.h: 27 (WebCore::JSDOMWindowShell::setWindow): Update our hash. 28 (WebCore::JSDOMWindowShell::clearFormerWindow): Ditto. 29 * bindings/js/JSDocumentCustom.cpp: 30 (WebCore::toJS): Don't set self as a property map property of 31 the window, this is no longer necessary. 32 * bindings/js/kjs_proxy.cpp: 33 (WebCore::KJSProxy::initScript): Update document for the 34 newly created window. 35 * bindings/js/kjs_proxy.h: 36 * page/Frame.cpp: 37 (WebCore::Frame::setDocument): If the document is not null, 38 update our window. 39 1 40 2008-05-26 Anders Carlsson <andersca@apple.com> 2 41 -
trunk/WebCore/bindings/js/JSDOMWindowBase.cpp
r33979 r34143 185 185 // Time in milliseconds before the script timeout handler kicks in. 186 186 setTimeoutTime(10000); 187 188 GlobalPropertyInfo staticGlobals[] = { 189 GlobalPropertyInfo("document", jsNull(), DontDelete | ReadOnly), 190 GlobalPropertyInfo("window", d->m_shell, DontDelete | ReadOnly) 191 }; 192 193 addStaticGlobals(staticGlobals, sizeof(staticGlobals) / sizeof(GlobalPropertyInfo)); 194 } 195 196 void JSDOMWindowBase::updateDocument() 197 { 198 ASSERT(m_impl->document()); 199 ExecState* exec = globalExec(); 200 symbolTablePutWithAttributes("document", toJS(exec, m_impl->document()), DontDelete | ReadOnly); 187 201 } 188 202 189 203 JSDOMWindowBase::~JSDOMWindowBase() 190 204 { 205 d->m_shell->clearFormerWindow(asJSDOMWindow(this)); 206 191 207 clearAllTimeouts(); 192 208 -
trunk/WebCore/bindings/js/JSDOMWindowBase.h
r33979 r34143 54 54 public: 55 55 virtual ~JSDOMWindowBase(); 56 57 void updateDocument(); 56 58 57 59 DOMWindow* impl() const { return m_impl.get(); } -
trunk/WebCore/bindings/js/JSDOMWindowShell.cpp
r33038 r34143 45 45 : Base(jsNull()) 46 46 , m_window(0) 47 , m_liveFormerWindows(new HashSet<JSDOMWindow*>) 47 48 { 48 49 m_window = new JSDOMWindow(domWindow, this); … … 144 145 } 145 146 147 148 void JSDOMWindowShell::updateDocument() 149 { 150 m_window->updateDocument(); 151 HashSet<JSDOMWindow*>::iterator end = m_liveFormerWindows->end(); 152 for (HashSet<JSDOMWindow*>::iterator it = m_liveFormerWindows->begin(); it != end; ++it) 153 (*it)->updateDocument(); 154 } 155 146 156 // ---- 147 157 // Conversion methods -
trunk/WebCore/bindings/js/JSDOMWindowShell.h
r33038 r34143 48 48 { 49 49 ASSERT_ARG(window, window); 50 m_liveFormerWindows->add(m_window); 50 51 m_window = window; 51 52 setPrototype(window->prototype()); … … 76 77 void disconnectFrame(); 77 78 void clear(); 79 void updateDocument(); 80 81 void clearFormerWindow(JSDOMWindow* window) { m_liveFormerWindows->remove(window); } 78 82 79 83 private: 80 84 JSDOMWindow* m_window; 85 HashSet<JSDOMWindow*>* m_liveFormerWindows; 81 86 }; 82 87 -
trunk/WebCore/bindings/js/JSDocumentCustom.cpp
r33979 r34143 93 93 // Make sure the document is kept around by the window object, and works right with the 94 94 // back/forward cache. 95 if (doc->frame()) 96 toJSDOMWindowShell(doc->frame())->window()->putDirect("document", ret, DontDelete|ReadOnly); 97 else { 95 if (!doc->frame()) { 98 96 size_t nodeCount = 0; 99 97 for (Node* n = doc; n; n = n->traverseNextNode()) -
trunk/WebCore/bindings/js/kjs_proxy.cpp
r33979 r34143 156 156 157 157 m_windowShell = new JSDOMWindowShell(m_frame->domWindow()); 158 m_windowShell->updateDocument(); 158 159 159 160 if (Page* page = m_frame->page()) { … … 163 164 164 165 m_frame->loader()->dispatchWindowObjectAvailable(); 165 }166 167 void KJSProxy::clearDocumentWrapper()168 {169 if (!m_windowShell)170 return;171 172 JSLock lock;173 m_windowShell->window()->removeDirect("document");174 166 } 175 167 -
trunk/WebCore/bindings/js/kjs_proxy.h
r32844 r34143 68 68 void setEventHandlerLineno(int lineno) { m_handlerLineno = lineno; } 69 69 70 void clearDocumentWrapper();71 72 70 void setProcessingTimerCallback(bool b) { m_processingTimerCallback = b; } 73 71 bool processingUserGesture() const; -
trunk/WebCore/page/Frame.cpp
r34023 r34143 259 259 d->m_doc->attach(); 260 260 261 // Remove the cached 'document' property, which is now stale. 262 d->m_jscript.clearDocumentWrapper(); 261 // Update the cached 'document' property, which is now stale. 262 if (d->m_doc && d->m_jscript.haveWindowShell()) { 263 JSLock lock; 264 d->m_jscript.windowShell()->updateDocument(); 265 } 263 266 } 264 267
Note: See TracChangeset
for help on using the changeset viewer.