namespace WebCore {
-PassOwnPtr<InjectedScriptManager> InjectedScriptManager::create()
+PassOwnPtr<InjectedScriptManager> InjectedScriptManager::createForPage()
{
- return adoptPtr(new InjectedScriptManager());
+ return adoptPtr(new InjectedScriptManager(&InjectedScriptManager::canAccessInspectedWindow));
}
-InjectedScriptManager::InjectedScriptManager()
+PassOwnPtr<InjectedScriptManager> InjectedScriptManager::createForWorker()
+{
+ return adoptPtr(new InjectedScriptManager(&InjectedScriptManager::canAccessInspectedWorkerContext));
+}
+
+InjectedScriptManager::InjectedScriptManager(InspectedStateAccessCheck accessCheck)
: m_nextInjectedScriptId(1)
, m_injectedScriptHost(InjectedScriptHost::create())
+ , m_inspectedStateAccessCheck(accessCheck)
{
}
m_idToInjectedScript.clear();
}
+bool InjectedScriptManager::canAccessInspectedWorkerContext(ScriptState*)
+{
+ return true;
+}
+
void InjectedScriptManager::releaseObjectGroup(const String& objectGroup)
{
for (IdToInjectedScriptMap::iterator it = m_idToInjectedScript.begin(); it != m_idToInjectedScript.end(); ++it)