1. hash
HashMap
KeyArg
MappedArg
HashArg
KeyTraitsArg (KeyTraits)
MappedTraitsArg (MappedTraits)
函數有值參數,模塊有類型參數,也可以有值參數。
Traits:
1.基類
GenericHashTraitsBase
定義如下:
template<bool isInteger, typename T> struct GenericHashTraitsBase;
沒有任何成員和函數。
2.繼承它的基礎類型
2.1
template<typename T> struct GenericHashTraitsBase<false, T>
另外一個模板,將上面的值參數給實例化了。
裏面有三個成員變量
static const bool emptyValueIsZero = false;
static const bool needsDestruction = true;
static const int minimumTableSize = 64;
2.2
template<typename T> struct GenericHashTraitsBase<true, T> : GenericHashTraitsBase<false, T>
同2.1,只是值參數被賦爲false,對於false,2個變量的值也改變如下:
static const bool emptyValueIsZero = true;
static const bool needsDestruction = false;
由於支持了null,需要添加2個函數來對其進行支持
2.3
template<typename T> struct GenericHashTraits : GenericHashTraitsBase<IsInteger<T>::value, T>
值參數ture或者false是由另外一個函數模板返回。(函數模板,跟進不同的類型,實行不同的操作。在此就是上面成員變量的值不同)
裏面主要定義了3個函數
static void store(const T& value, T& storage) { storage = value; }
static PassOutType passOut(const T& value) { return value; }
static PeekType peek(const T& value) { return value; }
2.4
template<typename T> struct HashTraits : GenericHashTraits<T> { };
3.其他類型
3.1
template<typename T> struct FloatHashTraits : GenericHashTraits<T>
static const bool needsDestruction = false;
static T emptyValue() { return std::numeric_limits<T>::infinity(); }
static void constructDeletedValue(T& slot) { slot = -std::numeric_limits<T>::infinity(); }
static bool isDeletedValue(T value) { return value == -std::numeric_limits<T>::infinity(); }
2.frame
Page(PageClient):
Chrome Settings BackForwardController Frame PluginData RenderTheme EditorClient
DragCaretController DragController FocusController ContextMenuController
InspectorController GeolocationController DeviceMotionController DeviceOrientationController
Frame(Page):
Page FrameTree FrameLoader DOMWindow FrameView Document ScriptController
Editor FrameSelection EventHandler
FrameLoader(Frame,FrameLoaderClient)
Frame FrameLoaderClient
PolicyChecker HistoryController ResourceLoadNotifier SubframeLoader IconController
DocumentLoader(m_documentLoader/m_provisionalDocumentLoader/m_policyDocumentLoader)
FrameNetworkingContext
to be continued.