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

Side by Side Diff: Source/core/xml/XMLHttpRequest.cpp

Issue 27571005: Replace Timers used in ActiveDOMObject with AsyncMethodRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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 | « Source/core/xml/XMLHttpRequest.h ('k') | Source/modules/mediasource/SourceBuffer.h » ('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) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org>
4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org>
5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved.
6 * Copyright (C) 2012 Intel Corporation 6 * Copyright (C) 2012 Intel Corporation
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 , m_createdDocument(false) 175 , m_createdDocument(false)
176 , m_error(false) 176 , m_error(false)
177 , m_uploadEventsAllowed(true) 177 , m_uploadEventsAllowed(true)
178 , m_uploadComplete(false) 178 , m_uploadComplete(false)
179 , m_sameOriginRequest(true) 179 , m_sameOriginRequest(true)
180 , m_receivedLength(0) 180 , m_receivedLength(0)
181 , m_lastSendLineNumber(0) 181 , m_lastSendLineNumber(0)
182 , m_exceptionCode(0) 182 , m_exceptionCode(0)
183 , m_progressEventThrottle(this) 183 , m_progressEventThrottle(this)
184 , m_responseTypeCode(ResponseTypeDefault) 184 , m_responseTypeCode(ResponseTypeDefault)
185 , m_protectionTimer(this, &XMLHttpRequest::dropProtection) 185 , m_dropProtectionRunner(this, &XMLHttpRequest::dropProtection)
186 , m_securityOrigin(securityOrigin) 186 , m_securityOrigin(securityOrigin)
187 { 187 {
188 initializeXMLHttpRequestStaticData(); 188 initializeXMLHttpRequestStaticData();
189 #ifndef NDEBUG 189 #ifndef NDEBUG
190 xmlHttpRequestCounter.increment(); 190 xmlHttpRequestCounter.increment();
191 #endif 191 #endif
192 ScriptWrappable::init(this); 192 ScriptWrappable::init(this);
193 } 193 }
194 194
195 XMLHttpRequest::~XMLHttpRequest() 195 XMLHttpRequest::~XMLHttpRequest()
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 m_state = DONE; 997 m_state = DONE;
998 return; 998 return;
999 } 999 }
1000 changeState(DONE); 1000 changeState(DONE);
1001 1001
1002 dispatchEventAndLoadEnd(EventTypeNames::abort); 1002 dispatchEventAndLoadEnd(EventTypeNames::abort);
1003 } 1003 }
1004 1004
1005 void XMLHttpRequest::dropProtectionSoon() 1005 void XMLHttpRequest::dropProtectionSoon()
1006 { 1006 {
1007 if (m_protectionTimer.isActive()) 1007 m_dropProtectionRunner.runAsync();
1008 return;
1009 m_protectionTimer.startOneShot(0);
1010 } 1008 }
1011 1009
1012 void XMLHttpRequest::dropProtection(Timer<XMLHttpRequest>*) 1010 void XMLHttpRequest::dropProtection()
1013 { 1011 {
1014 unsetPendingActivity(this); 1012 unsetPendingActivity(this);
1015 } 1013 }
1016 1014
1017 void XMLHttpRequest::overrideMimeType(const String& override) 1015 void XMLHttpRequest::overrideMimeType(const String& override)
1018 { 1016 {
1019 m_mimeTypeOverride = override; 1017 m_mimeTypeOverride = override;
1020 } 1018 }
1021 1019
1022 void XMLHttpRequest::setRequestHeader(const AtomicString& name, const String& va lue, ExceptionState& es) 1020 void XMLHttpRequest::setRequestHeader(const AtomicString& name, const String& va lue, ExceptionState& es)
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 { 1372 {
1375 return EventTargetNames::XMLHttpRequest; 1373 return EventTargetNames::XMLHttpRequest;
1376 } 1374 }
1377 1375
1378 ExecutionContext* XMLHttpRequest::executionContext() const 1376 ExecutionContext* XMLHttpRequest::executionContext() const
1379 { 1377 {
1380 return ActiveDOMObject::executionContext(); 1378 return ActiveDOMObject::executionContext();
1381 } 1379 }
1382 1380
1383 } // namespace WebCore 1381 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/xml/XMLHttpRequest.h ('k') | Source/modules/mediasource/SourceBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698