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

Side by Side Diff: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp

Issue 2407233002: Revert of Use per-frame task runner in XHR (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | 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) 2010 Julien Chaffraix <jchaffraix@webkit.org> All right 2 * Copyright (C) 2010 Julien Chaffraix <jchaffraix@webkit.org> All right
3 * reserved. 3 * reserved.
4 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 10 matching lines...) Expand all
21 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28 #include "core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h" 28 #include "core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h"
29 29
30 #include "core/EventTypeNames.h" 30 #include "core/EventTypeNames.h"
31 #include "core/dom/TaskRunnerHelper.h"
32 #include "core/events/ProgressEvent.h" 31 #include "core/events/ProgressEvent.h"
33 #include "core/inspector/InspectorInstrumentation.h" 32 #include "core/inspector/InspectorInstrumentation.h"
34 #include "core/inspector/InspectorTraceEvents.h" 33 #include "core/inspector/InspectorTraceEvents.h"
35 #include "core/xmlhttprequest/XMLHttpRequest.h" 34 #include "core/xmlhttprequest/XMLHttpRequest.h"
36 #include "public/platform/Platform.h" 35 #include "public/platform/Platform.h"
37 #include "public/platform/WebScheduler.h" 36 #include "public/platform/WebScheduler.h"
38 #include "public/platform/WebThread.h" 37 #include "public/platform/WebThread.h"
39 #include "wtf/Assertions.h" 38 #include "wtf/Assertions.h"
40 #include "wtf/text/AtomicString.h" 39 #include "wtf/text/AtomicString.h"
41 40
(...skipping 29 matching lines...) Expand all
71 DCHECK(m_isSet); 70 DCHECK(m_isSet);
72 71
73 Event* event = ProgressEvent::create(EventTypeNames::progress, 72 Event* event = ProgressEvent::create(EventTypeNames::progress,
74 m_lengthComputable, m_loaded, m_total); 73 m_lengthComputable, m_loaded, m_total);
75 clear(); 74 clear();
76 return event; 75 return event;
77 } 76 }
78 77
79 XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle( 78 XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle(
80 XMLHttpRequest* target) 79 XMLHttpRequest* target)
81 : TimerBase(TaskRunnerHelper::get(TaskType::Networking, 80 : TimerBase(
82 target->getExecutionContext())), 81 Platform::current()->currentThread()->scheduler()->timerTaskRunner()),
83 m_target(target), 82 m_target(target),
84 m_hasDispatchedProgressProgressEvent(false) { 83 m_hasDispatchedProgressProgressEvent(false) {
85 DCHECK(target); 84 DCHECK(target);
86 } 85 }
87 86
88 XMLHttpRequestProgressEventThrottle::~XMLHttpRequestProgressEventThrottle() {} 87 XMLHttpRequestProgressEventThrottle::~XMLHttpRequestProgressEventThrottle() {}
89 88
90 void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent( 89 void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent(
91 const AtomicString& type, 90 const AtomicString& type,
92 bool lengthComputable, 91 bool lengthComputable,
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 // over the list of active DOM objects to resume them, and any activated JS 188 // over the list of active DOM objects to resume them, and any activated JS
190 // event-handler could insert new active DOM objects to the list. 189 // event-handler could insert new active DOM objects to the list.
191 startOneShot(0, BLINK_FROM_HERE); 190 startOneShot(0, BLINK_FROM_HERE);
192 } 191 }
193 192
194 DEFINE_TRACE(XMLHttpRequestProgressEventThrottle) { 193 DEFINE_TRACE(XMLHttpRequestProgressEventThrottle) {
195 visitor->trace(m_target); 194 visitor->trace(m_target);
196 } 195 }
197 196
198 } // namespace blink 197 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698