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

Side by Side Diff: Source/core/dom/DOMNodeIds.h

Issue 1304043002: Make classes and structures in core/dom fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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/core/dom/DOMArrayPiece.h ('k') | Source/core/dom/DocumentEncodingData.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DOMNodeIds_h 5 #ifndef DOMNodeIds_h
6 #define DOMNodeIds_h 6 #define DOMNodeIds_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/dom/Node.h" 9 #include "core/dom/Node.h"
10 #include "core/dom/WeakIdentifierMap.h" 10 #include "core/dom/WeakIdentifierMap.h"
11 #include "wtf/Allocator.h"
11 12
12 namespace blink { 13 namespace blink {
13 14
14 #if !ENABLE(OILPAN) 15 #if !ENABLE(OILPAN)
15 template<> struct WeakIdentifierMapTraits<Node> { 16 template<> struct WeakIdentifierMapTraits<Node> {
16 static void removedFromIdentifierMap(Node*); 17 static void removedFromIdentifierMap(Node*);
17 static void addedToIdentifierMap(Node*); 18 static void addedToIdentifierMap(Node*);
18 }; 19 };
19 #endif 20 #endif
20 21
21 DECLARE_WEAK_IDENTIFIER_MAP(Node); 22 DECLARE_WEAK_IDENTIFIER_MAP(Node);
22 23
23 class CORE_EXPORT DOMNodeIds { 24 class CORE_EXPORT DOMNodeIds {
25 STATIC_ONLY(DOMNodeIds);
24 public: 26 public:
25 static int idForNode(Node*); 27 static int idForNode(Node*);
26 static Node* nodeForId(int id); 28 static Node* nodeForId(int id);
27 }; 29 };
28 30
29 } // namespace blink 31 } // namespace blink
30 32
31 33
32 #endif // DOMNodeIds_h 34 #endif // DOMNodeIds_h
OLDNEW
« no previous file with comments | « Source/core/dom/DOMArrayPiece.h ('k') | Source/core/dom/DocumentEncodingData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698