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

Side by Side Diff: Source/core/dom/custom/CustomElementScheduler.h

Issue 206623006: Avoid duplicate hash lookups in CustomElementScheduler::ensureCallbackQueue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix Created 6 years, 9 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/custom/CustomElementScheduler.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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 static CustomElementMicrotaskImportStep* scheduleImport(HTMLImportChild*); 56 static CustomElementMicrotaskImportStep* scheduleImport(HTMLImportChild*);
57 57
58 static void microtaskDispatcherDidFinish(); 58 static void microtaskDispatcherDidFinish();
59 static void callbackDispatcherDidFinish(); 59 static void callbackDispatcherDidFinish();
60 60
61 private: 61 private:
62 CustomElementScheduler() { } 62 CustomElementScheduler() { }
63 63
64 static CustomElementScheduler& instance(); 64 static CustomElementScheduler& instance();
65 65
66 CustomElementCallbackQueue* ensureCallbackQueue(PassRefPtr<Element>); 66 CustomElementCallbackQueue& ensureCallbackQueue(PassRefPtr<Element>);
67 CustomElementCallbackQueue* schedule(PassRefPtr<Element>); 67 CustomElementCallbackQueue& schedule(PassRefPtr<Element>);
68 68
69 // FIXME: Consider moving the element's callback queue to 69 // FIXME: Consider moving the element's callback queue to
70 // ElementRareData. Then the scheduler can become completely 70 // ElementRareData. Then the scheduler can become completely
71 // static. 71 // static.
72 void clearElementCallbackQueueMap(); 72 void clearElementCallbackQueueMap();
73 73
74 // The element -> callback queue map is populated by the scheduler 74 // The element -> callback queue map is populated by the scheduler
75 // and owns the lifetimes of the CustomElementCallbackQueues. 75 // and owns the lifetimes of the CustomElementCallbackQueues.
76 typedef HashMap<Element*, OwnPtr<CustomElementCallbackQueue> > ElementCallba ckQueueMap; 76 typedef HashMap<Element*, OwnPtr<CustomElementCallbackQueue> > ElementCallba ckQueueMap;
77 ElementCallbackQueueMap m_elementCallbackQueueMap; 77 ElementCallbackQueueMap m_elementCallbackQueueMap;
78 }; 78 };
79 79
80 } 80 }
81 81
82 #endif // CustomElementScheduler_h 82 #endif // CustomElementScheduler_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/custom/CustomElementScheduler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698