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

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

Issue 288323004: HTML Imports: Get rid of needsProcessOrStop() from dom/custom/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Switched to two-queue approach Created 6 years, 7 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 HTMLImportLoader* loader = element->document().importLoader(); 77 HTMLImportLoader* loader = element->document().importLoader();
78 OwnPtr<CustomElementMicrotaskResolutionStep> step = CustomElementMicrotaskRe solutionStep::create(context, element, descriptor); 78 OwnPtr<CustomElementMicrotaskResolutionStep> step = CustomElementMicrotaskRe solutionStep::create(context, element, descriptor);
79 CustomElementMicrotaskDispatcher::instance().enqueue(loader, step.release()) ; 79 CustomElementMicrotaskDispatcher::instance().enqueue(loader, step.release()) ;
80 } 80 }
81 81
82 CustomElementMicrotaskImportStep* CustomElementScheduler::scheduleImport(HTMLImp ortChild* import) 82 CustomElementMicrotaskImportStep* CustomElementScheduler::scheduleImport(HTMLImp ortChild* import)
83 { 83 {
84 ASSERT(!import->isDone()); 84 ASSERT(!import->isDone());
85 ASSERT(import->parent()); 85 ASSERT(import->parent());
86 86
87 // Ownership of the new step is transferred to the parent
88 // processing step, or the base queue.
87 OwnPtr<CustomElementMicrotaskImportStep> step = CustomElementMicrotaskImport Step::create(import); 89 OwnPtr<CustomElementMicrotaskImportStep> step = CustomElementMicrotaskImport Step::create(import);
88 CustomElementMicrotaskImportStep* rawStep = step.get(); 90 CustomElementMicrotaskImportStep* rawStep = step.get();
89 91 if (import->isSync())
90 // Ownership of the new step is transferred to the parent 92 CustomElementMicrotaskDispatcher::instance().enqueue(import->parent()->l oader(), step.release());
91 // processing step, or the base queue. 93 else
92 CustomElementMicrotaskDispatcher::instance().enqueue(import->parent()->loade r(), step.release()); 94 CustomElementMicrotaskDispatcher::instance().enqueueAsyncImportStep(step .release());
93
94 return rawStep; 95 return rawStep;
95 } 96 }
96 97
97 CustomElementScheduler& CustomElementScheduler::instance() 98 CustomElementScheduler& CustomElementScheduler::instance()
98 { 99 {
99 DEFINE_STATIC_LOCAL(CustomElementScheduler, instance, ()); 100 DEFINE_STATIC_LOCAL(CustomElementScheduler, instance, ());
100 return instance; 101 return instance;
101 } 102 }
102 103
103 CustomElementCallbackQueue& CustomElementScheduler::ensureCallbackQueue(PassRefP tr<Element> element) 104 CustomElementCallbackQueue& CustomElementScheduler::ensureCallbackQueue(PassRefP tr<Element> element)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // The processing stack is active. 145 // The processing stack is active.
145 CustomElementCallbackDispatcher::instance().enqueue(&callbackQueue); 146 CustomElementCallbackDispatcher::instance().enqueue(&callbackQueue);
146 return callbackQueue; 147 return callbackQueue;
147 } 148 }
148 149
149 CustomElementMicrotaskDispatcher::instance().enqueue(&callbackQueue); 150 CustomElementMicrotaskDispatcher::instance().enqueue(&callbackQueue);
150 return callbackQueue; 151 return callbackQueue;
151 } 152 }
152 153
153 } // namespace WebCore 154 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698