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

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

Issue 23523012: Have CustomElement::didEnterDocument() / didLeaveDocument() take a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/dom/CustomElement.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 (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // API for registration contexts 57 // API for registration contexts
58 static void define(Element*, PassRefPtr<CustomElementDefinition>); 58 static void define(Element*, PassRefPtr<CustomElementDefinition>);
59 59
60 // API for wrapper creation, which uses a definition as a key 60 // API for wrapper creation, which uses a definition as a key
61 static CustomElementDefinition* definitionFor(Element*); 61 static CustomElementDefinition* definitionFor(Element*);
62 62
63 // API for Element to kick off changes 63 // API for Element to kick off changes
64 64
65 static void didFinishParsingChildren(Element*); 65 static void didFinishParsingChildren(Element*);
66 static void attributeDidChange(Element*, const AtomicString& name, const Ato micString& oldValue, const AtomicString& newValue); 66 static void attributeDidChange(Element*, const AtomicString& name, const Ato micString& oldValue, const AtomicString& newValue);
67 static void didEnterDocument(Element*, Document*); 67 static void didEnterDocument(Element*, const Document&);
68 static void didLeaveDocument(Element*, Document*); 68 static void didLeaveDocument(Element*, const Document&);
69 static void wasDestroyed(Element*); 69 static void wasDestroyed(Element*);
70 70
71 private: 71 private:
72 CustomElement(); 72 CustomElement();
73 73
74 static Vector<AtomicString>& embedderCustomElementNames(); 74 static Vector<AtomicString>& embedderCustomElementNames();
75 75
76 // Maps resolved elements to their definitions 76 // Maps resolved elements to their definitions
77 77
78 class DefinitionMap { 78 class DefinitionMap {
79 WTF_MAKE_NONCOPYABLE(DefinitionMap); 79 WTF_MAKE_NONCOPYABLE(DefinitionMap);
80 public: 80 public:
81 DefinitionMap() { } 81 DefinitionMap() { }
82 ~DefinitionMap() { } 82 ~DefinitionMap() { }
83 83
84 void add(Element*, PassRefPtr<CustomElementDefinition>); 84 void add(Element*, PassRefPtr<CustomElementDefinition>);
85 void remove(Element* element) { m_definitions.remove(element); } 85 void remove(Element* element) { m_definitions.remove(element); }
86 CustomElementDefinition* get(Element* element) const { return m_definiti ons.get(element); } 86 CustomElementDefinition* get(Element* element) const { return m_definiti ons.get(element); }
87 87
88 private: 88 private:
89 typedef HashMap<Element*, RefPtr<CustomElementDefinition> > ElementDefin itionHashMap; 89 typedef HashMap<Element*, RefPtr<CustomElementDefinition> > ElementDefin itionHashMap;
90 ElementDefinitionHashMap m_definitions; 90 ElementDefinitionHashMap m_definitions;
91 }; 91 };
92 static DefinitionMap& definitions(); 92 static DefinitionMap& definitions();
93 }; 93 };
94 94
95 } 95 }
96 96
97 #endif // CustomElement_h 97 #endif // CustomElement_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/CustomElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698