Commit 59134973 authored by tyoshino@chromium.org's avatar tyoshino@chromium.org

[DocumentThreadableLoader] Rename notifyResponseReceived to reportResponseReceived

"notifySomething" style method naming is often used to notify its
client about completion. This is just for inspector and console logging.
It's surprising that we see a function looks like notifying completion
called inside access control failure path. Use reportSomething that
is often used to methods that report to inspector or writing some log.

R=mkwst
BUG=none

Review URL: https://codereview.chromium.org/700413002

git-svn-id: svn://svn.chromium.org/blink/trunk@184905 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 5de394a8
...@@ -380,7 +380,7 @@ void DocumentThreadableLoader::handlePreflightResponse(const ResourceResponse& r ...@@ -380,7 +380,7 @@ void DocumentThreadableLoader::handlePreflightResponse(const ResourceResponse& r
CrossOriginPreflightResultCache::shared().appendEntry(securityOrigin()->toString(), m_actualRequest->url(), preflightResult.release()); CrossOriginPreflightResultCache::shared().appendEntry(securityOrigin()->toString(), m_actualRequest->url(), preflightResult.release());
} }
void DocumentThreadableLoader::notifyResponseReceived(unsigned long identifier, const ResourceResponse& response) void DocumentThreadableLoader::reportResponseReceived(unsigned long identifier, const ResourceResponse& response)
{ {
DocumentLoader* loader = m_document.frame()->loader().documentLoader(); DocumentLoader* loader = m_document.frame()->loader().documentLoader();
TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ResourceReceiveResponse", "data", InspectorReceiveResponseEvent::data(identifier, m_document.frame(), response)); TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ResourceReceiveResponse", "data", InspectorReceiveResponseEvent::data(identifier, m_document.frame(), response));
...@@ -395,7 +395,7 @@ void DocumentThreadableLoader::handleResponse(unsigned long identifier, const Re ...@@ -395,7 +395,7 @@ void DocumentThreadableLoader::handleResponse(unsigned long identifier, const Re
ASSERT(m_client); ASSERT(m_client);
if (m_actualRequest) { if (m_actualRequest) {
notifyResponseReceived(identifier, response); reportResponseReceived(identifier, response);
handlePreflightResponse(response); handlePreflightResponse(response);
return; return;
} }
...@@ -416,7 +416,7 @@ void DocumentThreadableLoader::handleResponse(unsigned long identifier, const Re ...@@ -416,7 +416,7 @@ void DocumentThreadableLoader::handleResponse(unsigned long identifier, const Re
if (!m_sameOriginRequest && m_options.crossOriginRequestPolicy == UseAccessControl) { if (!m_sameOriginRequest && m_options.crossOriginRequestPolicy == UseAccessControl) {
String accessControlErrorDescription; String accessControlErrorDescription;
if (!passesAccessControlCheck(response, effectiveAllowCredentials(), securityOrigin(), accessControlErrorDescription)) { if (!passesAccessControlCheck(response, effectiveAllowCredentials(), securityOrigin(), accessControlErrorDescription)) {
notifyResponseReceived(identifier, response); reportResponseReceived(identifier, response);
m_client->didFailAccessControlCheck(ResourceError(errorDomainBlinkInternal, 0, response.url().string(), accessControlErrorDescription)); m_client->didFailAccessControlCheck(ResourceError(errorDomainBlinkInternal, 0, response.url().string(), accessControlErrorDescription));
return; return;
} }
......
...@@ -81,8 +81,9 @@ class DocumentThreadableLoader final : public ThreadableLoader, private Resource ...@@ -81,8 +81,9 @@ class DocumentThreadableLoader final : public ThreadableLoader, private Resource
void cancelWithError(const ResourceError&); void cancelWithError(const ResourceError&);
// Notify Inspector about resource response. Use this method if response is not going to be finished normally. // Notify Inspector and log to console about resource response. Use
void notifyResponseReceived(unsigned long identifier, const ResourceResponse&); // this method if response is not going to be finished normally.
void reportResponseReceived(unsigned long identifier, const ResourceResponse&);
// Methods containing code to handle resource fetch results which is // Methods containing code to handle resource fetch results which is
// common to both sync and async mode. // common to both sync and async mode.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment