Commit 1c9fe77b authored by xiang.long@intel.com's avatar xiang.long@intel.com

ServiceWorker: Set provider host document URL for no-cache load.

A no-cache loaded page should still have registration capability. If
the document URL is not set, the registration will fail with "SecurityError".

BUG=392405

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282906 0039d316-1c4b-4281-b951-d872f2087c98
parent 7ed9e0a1
...@@ -46,13 +46,21 @@ ServiceWorkerControlleeRequestHandler:: ...@@ -46,13 +46,21 @@ ServiceWorkerControlleeRequestHandler::
net::URLRequestJob* ServiceWorkerControlleeRequestHandler::MaybeCreateJob( net::URLRequestJob* ServiceWorkerControlleeRequestHandler::MaybeCreateJob(
net::URLRequest* request, net::URLRequest* request,
net::NetworkDelegate* network_delegate) { net::NetworkDelegate* network_delegate) {
if (!context_ || !provider_host_ || if (!context_ || !provider_host_) {
request->load_flags() & net::LOAD_BYPASS_CACHE) {
// We can't do anything other than to fall back to network. // We can't do anything other than to fall back to network.
job_ = NULL; job_ = NULL;
return NULL; return NULL;
} }
if (request->load_flags() & net::LOAD_BYPASS_CACHE) {
if (is_main_resource_load_) {
provider_host_->SetDocumentUrl(
net::SimplifyUrlForRequest(request->url()));
}
job_ = NULL;
return NULL;
}
// This may get called multiple times for original and redirect requests: // This may get called multiple times for original and redirect requests:
// A. original request case: job_ is null, no previous location info. // A. original request case: job_ is null, no previous location info.
// B. redirect or restarted request case: // B. redirect or restarted request case:
......
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