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

Side by Side Diff: Source/core/dom/custom/CustomElementObserver.cpp

Issue 789253003: Remove dead code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years 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
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 27 matching lines...) Expand all
38 // Maps elements to the observer watching them. At most one per 38 // Maps elements to the observer watching them. At most one per
39 // element at a time. 39 // element at a time.
40 typedef WillBeHeapHashMap<RawPtrWillBeWeakMember<Element>, RawPtrWillBeMember<Cu stomElementObserver> > ElementObserverMap; 40 typedef WillBeHeapHashMap<RawPtrWillBeWeakMember<Element>, RawPtrWillBeMember<Cu stomElementObserver> > ElementObserverMap;
41 41
42 static ElementObserverMap& elementObservers() 42 static ElementObserverMap& elementObservers()
43 { 43 {
44 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<ElementObserverMap>, map, (adoptP trWillBeNoop(new ElementObserverMap()))); 44 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<ElementObserverMap>, map, (adoptP trWillBeNoop(new ElementObserverMap())));
45 return *map; 45 return *map;
46 } 46 }
47 47
48 void CustomElementObserver::notifyElementDidFinishParsingChildren(Element* eleme nt)
49 {
50 ElementObserverMap::iterator it = elementObservers().find(element);
51 if (it == elementObservers().end())
52 return;
53 it->value->elementDidFinishParsingChildren(element);
54 }
55
56 void CustomElementObserver::notifyElementWasDestroyed(Element* element) 48 void CustomElementObserver::notifyElementWasDestroyed(Element* element)
57 { 49 {
58 ElementObserverMap::iterator it = elementObservers().find(element); 50 ElementObserverMap::iterator it = elementObservers().find(element);
59 if (it == elementObservers().end()) 51 if (it == elementObservers().end())
60 return; 52 return;
61 it->value->elementWasDestroyed(element); 53 it->value->elementWasDestroyed(element);
62 } 54 }
63 55
64 void CustomElementObserver::observe(Element* element) 56 void CustomElementObserver::observe(Element* element)
65 { 57 {
66 ElementObserverMap::AddResult result = elementObservers().add(element, this) ; 58 ElementObserverMap::AddResult result = elementObservers().add(element, this) ;
67 ASSERT_UNUSED(result, result.isNewEntry); 59 ASSERT_UNUSED(result, result.isNewEntry);
68 } 60 }
69 61
70 void CustomElementObserver::unobserve(Element* element) 62 void CustomElementObserver::unobserve(Element* element)
71 { 63 {
72 CustomElementObserver* observer = elementObservers().take(element); 64 CustomElementObserver* observer = elementObservers().take(element);
73 ASSERT_UNUSED(observer, observer == this); 65 ASSERT_UNUSED(observer, observer == this);
74 } 66 }
75 67
76 } // namespace blink 68 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/custom/CustomElementObserver.h ('k') | Source/core/dom/custom/CustomElementUpgradeCandidateMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698