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

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

Issue 23009004: Process Custom Elements in post-order. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing. Created 7 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 | Annotate | Revision Log
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 26 matching lines...) Expand all
37 37
38 class Element; 38 class Element;
39 39
40 class CustomElementObserver { 40 class CustomElementObserver {
41 public: 41 public:
42 CustomElementObserver() { } 42 CustomElementObserver() { }
43 virtual ~CustomElementObserver() { } 43 virtual ~CustomElementObserver() { }
44 44
45 // API for CustomElement to kick off notifications 45 // API for CustomElement to kick off notifications
46 46
47 static void notifyElementDidFinishParsingChildren(Element*);
47 static void notifyElementWasDestroyed(Element*); 48 static void notifyElementWasDestroyed(Element*);
48 49
49 protected: 50 protected:
50 void observe(Element*); 51 void observe(Element*);
51 void unobserve(Element*); 52 void unobserve(Element*);
52 53
54 virtual void elementDidFinishParsingChildren(Element*) = 0;
53 virtual void elementWasDestroyed(Element* element) { unobserve(element); } 55 virtual void elementWasDestroyed(Element* element) { unobserve(element); }
54 56
55 private: 57 private:
56 // Maps elements to the observer watching them. At most one per 58 // Maps elements to the observer watching them. At most one per
57 // element at a time. 59 // element at a time.
58 typedef HashMap<Element*, CustomElementObserver*> ElementObserverMap; 60 typedef HashMap<Element*, CustomElementObserver*> ElementObserverMap;
59 static ElementObserverMap& elementObservers(); 61 static ElementObserverMap& elementObservers();
60 }; 62 };
61 63
62 } 64 }
63 65
64 #endif // CustomElementObserver_h 66 #endif // CustomElementObserver_h
OLDNEW
« no previous file with comments | « Source/core/dom/CustomElementCallbackScheduler.cpp ('k') | Source/core/dom/CustomElementObserver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698