Reviewed by Darin Fisher.
https://bugs.webkit.org/show_bug.cgi?id=24306
Adding a flag to ResourceRequestBase to indicate whether or not upload
progress notifications are needed for a resource. This is useful to
avoid sending these notifications when there are no consumers
(especially in the Chromium case where IPC is involved).
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::reportUploadProgress):
(WebCore::ResourceRequestBase::setReportUploadProgress):
(WebCore::ResourceRequestBase::ResourceRequestBase):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::loadRequestAsynchronously):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@41500
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2009-03-06 Jay Campan <jcampan@google.com>
+
+ Reviewed by Darin Fisher.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24306
+
+ Adding a flag to ResourceRequestBase to indicate whether or not upload
+ progress notifications are needed for a resource. This is useful to
+ avoid sending these notifications when there are no consumers
+ (especially in the Chromium case where IPC is involved).
+
+ * platform/network/ResourceRequestBase.h:
+ (WebCore::ResourceRequestBase::reportUploadProgress):
+ (WebCore::ResourceRequestBase::setReportUploadProgress):
+ (WebCore::ResourceRequestBase::ResourceRequestBase):
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::loadRequestAsynchronously):
+
2009-03-06 Dmitry Titov <dimich@chromium.org>
Reviewed by Alexey Proskuryakov.
2009-03-06 Dmitry Titov <dimich@chromium.org>
Reviewed by Alexey Proskuryakov.
void setAllowHTTPCookies(bool allowHTTPCookies);
bool isConditional() const;
void setAllowHTTPCookies(bool allowHTTPCookies);
bool isConditional() const;
+
+ // Whether the associated ResourceHandleClient needs to be notified of
+ // upload progress made for that resource.
+ bool reportUploadProgress() const { return m_reportUploadProgress; }
+ void setReportUploadProgress(bool reportUploadProgress) { m_reportUploadProgress = reportUploadProgress; }
+
protected:
// Used when ResourceRequest is initialized from a platform representation of the request
ResourceRequestBase()
: m_resourceRequestUpdated(false)
, m_platformRequestUpdated(true)
protected:
// Used when ResourceRequest is initialized from a platform representation of the request
ResourceRequestBase()
: m_resourceRequestUpdated(false)
, m_platformRequestUpdated(true)
+ , m_reportUploadProgress(false)
, m_allowHTTPCookies(true)
, m_resourceRequestUpdated(true)
, m_platformRequestUpdated(false)
, m_allowHTTPCookies(true)
, m_resourceRequestUpdated(true)
, m_platformRequestUpdated(false)
+ , m_reportUploadProgress(false)
bool m_allowHTTPCookies;
mutable bool m_resourceRequestUpdated;
mutable bool m_platformRequestUpdated;
bool m_allowHTTPCookies;
mutable bool m_resourceRequestUpdated;
mutable bool m_platformRequestUpdated;
+ bool m_reportUploadProgress;
private:
const ResourceRequest& asResourceRequest() const;
private:
const ResourceRequest& asResourceRequest() const;
// for local files otherwise, <rdar://problem/5671813>.
LoadCallbacks callbacks = m_inPreflight ? DoNotSendLoadCallbacks : SendLoadCallbacks;
ContentSniff contentSniff = request.url().isLocalFile() ? SniffContent : DoNotSniffContent;
// for local files otherwise, <rdar://problem/5671813>.
LoadCallbacks callbacks = m_inPreflight ? DoNotSendLoadCallbacks : SendLoadCallbacks;
ContentSniff contentSniff = request.url().isLocalFile() ? SniffContent : DoNotSniffContent;
+
+ if (m_upload)
+ request.setReportUploadProgress(true);
+
m_loader = ThreadableLoader::create(scriptExecutionContext(), this, request, callbacks, contentSniff);
if (m_loader) {
m_loader = ThreadableLoader::create(scriptExecutionContext(), this, request, callbacks, contentSniff);
if (m_loader) {