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

Side by Side Diff: Source/WebCore/bindings/v8/ScriptCachedFrameData.cpp

Issue 9340005: Merge 106846 - Before accessing a frame's script controller in V8 bindings, first check that the ... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 10 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
« no previous file with comments | « Source/WebCore/bindings/v8/ScheduledAction.cpp ('k') | Source/WebCore/page/DOMTimer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2010, The Android Open Source Project 2 * Copyright 2010, The Android Open Source Project
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 * * Redistributions of source code must retain the above copyright 7 * * 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 * * Redistributions in binary form must reproduce the above copyright 9 * * 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 DOMWindow* ScriptCachedFrameData::domWindow() const 52 DOMWindow* ScriptCachedFrameData::domWindow() const
53 { 53 {
54 return m_domWindow; 54 return m_domWindow;
55 } 55 }
56 56
57 void ScriptCachedFrameData::restore(Frame* frame) 57 void ScriptCachedFrameData::restore(Frame* frame)
58 { 58 {
59 if (m_context.get().IsEmpty()) 59 if (m_context.get().IsEmpty())
60 return; 60 return;
61 61
62 if (!frame->script()->canExecuteScripts(NotAboutToExecuteScript)) 62 if (!frame || !frame->script()->canExecuteScripts(NotAboutToExecuteScript))
63 return; 63 return;
64 64
65 v8::HandleScope handleScope; 65 v8::HandleScope handleScope;
66 v8::Context::Scope contextScope(m_context.get()); 66 v8::Context::Scope contextScope(m_context.get());
67 67
68 m_context.get()->ReattachGlobal(m_global.get()); 68 m_context.get()->ReattachGlobal(m_global.get());
69 V8Proxy* proxy = V8Proxy::retrieve(frame); 69 V8Proxy* proxy = V8Proxy::retrieve(frame);
70 if (proxy) 70 if (proxy)
71 proxy->windowShell()->setContext(m_context.get()); 71 proxy->windowShell()->setContext(m_context.get());
72 } 72 }
73 73
74 void ScriptCachedFrameData::clear() 74 void ScriptCachedFrameData::clear()
75 { 75 {
76 m_context.clear(); 76 m_context.clear();
77 m_global.clear(); 77 m_global.clear();
78 } 78 }
79 79
80 } // namespace WebCore 80 } // namespace WebCore
81 81
82 #endif // PLATFORM(QT) 82 #endif // PLATFORM(QT)
OLDNEW
« no previous file with comments | « Source/WebCore/bindings/v8/ScheduledAction.cpp ('k') | Source/WebCore/page/DOMTimer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698