-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move DOMObjectHashTableMap, DOMWrapperWorld and WebCoreJSClientData into their own files. * GNUmakefile.am: * WebCore.gypi: * WebCore.pro: * WebCore.vcproj/WebCore.vcproj: * WebCore.xcodeproj/project.pbxproj: * bindings/js/DOMObjectHashTableMap.cpp: Copied from bindings/js/JSDOMBinding.cpp. * bindings/js/DOMObjectHashTableMap.h: Copied from bindings/js/JSDOMBinding.h. (WebCore::DOMObjectHashTableMap::~DOMObjectHashTableMap): (WebCore::DOMObjectHashTableMap::get): * bindings/js/DOMWrapperWorld.cpp: Copied from bindings/js/JSDOMBinding.cpp. (WebCore::forgetWorldOfDOMNodesForDocument): * bindings/js/DOMWrapperWorld.h: Copied from bindings/js/JSDOMBinding.h. (WebCore::DOMWrapperWorld::create): (WebCore::DOMWrapperWorld::rememberDocument): (WebCore::DOMWrapperWorld::forgetDocument): (WebCore::DOMWrapperWorld::isNormal): (WebCore::debuggerWorld): (WebCore::pluginWorld): (WebCore::currentWorld): (WebCore::Document::getWrapperCache): * bindings/js/JSDOMBinding.cpp: * bindings/js/JSDOMBinding.h: * bindings/js/JSDOMWindowBase.cpp: * bindings/js/ScriptController.cpp: * bindings/js/WebCoreJSClientData.h: Copied from bindings/js/JSDOMBinding.h. (WebCore::WebCoreJSClientData::WebCoreJSClientData): (WebCore::WebCoreJSClientData::~WebCoreJSClientData): (WebCore::WebCoreJSClientData::normalWorld): (WebCore::WebCoreJSClientData::getAllWorlds): (WebCore::WebCoreJSClientData::rememberWorld): (WebCore::WebCoreJSClientData::forgetWorld): * bindings/js/WorkerScriptController.cpp: Canonical link: https://commits.webkit.org/46928@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55631 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Sam Weinig
committed
Mar 7, 2010
1 parent
2d7f08d
commit a641b0b
Showing
16 changed files
with
434 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org) | ||
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | ||
* Copyright (C) 2007 Samuel Weinig <sam@webkit.org> | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
#include "config.h" | ||
#include "DOMObjectHashTableMap.h" | ||
|
||
#include "WebCoreJSClientData.h" | ||
|
||
using namespace JSC; | ||
|
||
namespace WebCore{ | ||
|
||
DOMObjectHashTableMap& DOMObjectHashTableMap::mapFor(JSGlobalData& globalData) | ||
{ | ||
JSGlobalData::ClientData* clientData = globalData.clientData; | ||
ASSERT(clientData); | ||
return static_cast<WebCoreJSClientData*>(clientData)->hashTableMap; | ||
} | ||
|
||
} // namespace WebCore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org) | ||
* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights reserved. | ||
* Copyright (C) 2007 Samuel Weinig <sam@webkit.org> | ||
* Copyright (C) 2009 Google, Inc. All rights reserved. | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
#ifndef DOMObjectHashTableMap_h | ||
#define DOMObjectHashTableMap_h | ||
|
||
#include <runtime/Lookup.h> | ||
#include <wtf/HashMap.h> | ||
|
||
namespace JSC { | ||
class JSGlobalData; | ||
} | ||
|
||
namespace WebCore { | ||
|
||
// Map from static HashTable instances to per-GlobalData ones. | ||
class DOMObjectHashTableMap { | ||
public: | ||
static DOMObjectHashTableMap& mapFor(JSC::JSGlobalData&); | ||
|
||
~DOMObjectHashTableMap() | ||
{ | ||
HashMap<const JSC::HashTable*, JSC::HashTable>::iterator mapEnd = m_map.end(); | ||
for (HashMap<const JSC::HashTable*, JSC::HashTable>::iterator iter = m_map.begin(); iter != m_map.end(); ++iter) | ||
iter->second.deleteTable(); | ||
} | ||
|
||
const JSC::HashTable* get(const JSC::HashTable* staticTable) | ||
{ | ||
HashMap<const JSC::HashTable*, JSC::HashTable>::iterator iter = m_map.find(staticTable); | ||
if (iter != m_map.end()) | ||
return &iter->second; | ||
return &m_map.set(staticTable, JSC::HashTable(*staticTable)).first->second; | ||
} | ||
|
||
private: | ||
HashMap<const JSC::HashTable*, JSC::HashTable> m_map; | ||
}; | ||
|
||
} // namespace WebCore | ||
|
||
#endif // DOMObjectHashTableMap_h |
Oops, something went wrong.