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

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

Issue 383363002: DevTools: Fix async stacks instrumentation for XHRs. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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) 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 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 m_error = true; 1019 m_error = true;
1020 } 1020 }
1021 1021
1022 void XMLHttpRequest::dispatchProgressEvent(const AtomicString& type, long long r eceivedLength, long long expectedLength) 1022 void XMLHttpRequest::dispatchProgressEvent(const AtomicString& type, long long r eceivedLength, long long expectedLength)
1023 { 1023 {
1024 bool lengthComputable = expectedLength > 0 && receivedLength <= expectedLeng th; 1024 bool lengthComputable = expectedLength > 0 && receivedLength <= expectedLeng th;
1025 unsigned long long loaded = receivedLength >= 0 ? static_cast<unsigned long long>(receivedLength) : 0; 1025 unsigned long long loaded = receivedLength >= 0 ? static_cast<unsigned long long>(receivedLength) : 0;
1026 unsigned long long total = lengthComputable ? static_cast<unsigned long long >(expectedLength) : 0; 1026 unsigned long long total = lengthComputable ? static_cast<unsigned long long >(expectedLength) : 0;
1027 1027
1028 m_progressEventThrottle.dispatchProgressEvent(type, lengthComputable, loaded , total); 1028 m_progressEventThrottle.dispatchProgressEvent(type, lengthComputable, loaded , total);
1029
1030 if (type == EventTypeNames::loadend)
1031 InspectorInstrumentation::didDispatchXHRLoadendEvent(executionContext(), this);
1029 } 1032 }
1030 1033
1031 void XMLHttpRequest::dispatchProgressEventFromSnapshot(const AtomicString& type) 1034 void XMLHttpRequest::dispatchProgressEventFromSnapshot(const AtomicString& type)
1032 { 1035 {
1033 dispatchProgressEvent(type, m_receivedLength, m_response.expectedContentLeng th()); 1036 dispatchProgressEvent(type, m_receivedLength, m_response.expectedContentLeng th());
1034 } 1037 }
1035 1038
1036 void XMLHttpRequest::handleNetworkError() 1039 void XMLHttpRequest::handleNetworkError()
1037 { 1040 {
1038 WTF_LOG(Network, "XMLHttpRequest %p handleNetworkError()", this); 1041 WTF_LOG(Network, "XMLHttpRequest %p handleNetworkError()", this);
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1463 { 1466 {
1464 visitor->trace(m_responseBlob); 1467 visitor->trace(m_responseBlob);
1465 visitor->trace(m_responseStream); 1468 visitor->trace(m_responseStream);
1466 visitor->trace(m_responseDocument); 1469 visitor->trace(m_responseDocument);
1467 visitor->trace(m_progressEventThrottle); 1470 visitor->trace(m_progressEventThrottle);
1468 visitor->trace(m_upload); 1471 visitor->trace(m_upload);
1469 XMLHttpRequestEventTarget::trace(visitor); 1472 XMLHttpRequestEventTarget::trace(visitor);
1470 } 1473 }
1471 1474
1472 } // namespace WebCore 1475 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698