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

Side by Side Diff: content/browser/appcache/appcache_update_job.cc

Issue 2405483002: Make the request initiator Optional (Closed)
Patch Set: Introduce NullableOrigin to use for request initiator Created 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/appcache/appcache_update_job.h" 5 #include "content/browser/appcache/appcache_update_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 request_(job->service_->request_context() 161 request_(job->service_->request_context()
162 ->CreateRequest(url, net::DEFAULT_PRIORITY, this)), 162 ->CreateRequest(url, net::DEFAULT_PRIORITY, this)),
163 result_(UPDATE_OK), 163 result_(UPDATE_OK),
164 redirect_response_code_(-1) {} 164 redirect_response_code_(-1) {}
165 165
166 AppCacheUpdateJob::URLFetcher::~URLFetcher() { 166 AppCacheUpdateJob::URLFetcher::~URLFetcher() {
167 } 167 }
168 168
169 void AppCacheUpdateJob::URLFetcher::Start() { 169 void AppCacheUpdateJob::URLFetcher::Start() {
170 request_->set_first_party_for_cookies(job_->manifest_url_); 170 request_->set_first_party_for_cookies(job_->manifest_url_);
171 request_->set_initiator(url::Origin(job_->manifest_url_)); 171 request_->set_initiator(new url::NullableOrigin(job_->manifest_url_));
172 if (fetch_type_ == MANIFEST_FETCH && job_->doing_full_update_check_) 172 if (fetch_type_ == MANIFEST_FETCH && job_->doing_full_update_check_)
173 request_->SetLoadFlags(request_->load_flags() | net::LOAD_BYPASS_CACHE); 173 request_->SetLoadFlags(request_->load_flags() | net::LOAD_BYPASS_CACHE);
174 else if (existing_response_headers_.get()) 174 else if (existing_response_headers_.get())
175 AddConditionalHeaders(existing_response_headers_.get()); 175 AddConditionalHeaders(existing_response_headers_.get());
176 request_->Start(); 176 request_->Start();
177 } 177 }
178 178
179 void AppCacheUpdateJob::URLFetcher::OnReceivedRedirect( 179 void AppCacheUpdateJob::URLFetcher::OnReceivedRedirect(
180 net::URLRequest* request, 180 net::URLRequest* request,
181 const net::RedirectInfo& redirect_info, 181 const net::RedirectInfo& redirect_info,
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1705 // on this object after we've posted a task to delete ourselves. 1705 // on this object after we've posted a task to delete ourselves.
1706 if (group_) { 1706 if (group_) {
1707 group_->SetUpdateAppCacheStatus(AppCacheGroup::IDLE); 1707 group_->SetUpdateAppCacheStatus(AppCacheGroup::IDLE);
1708 group_ = NULL; 1708 group_ = NULL;
1709 } 1709 }
1710 1710
1711 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); 1711 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
1712 } 1712 }
1713 1713
1714 } // namespace content 1714 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/loader/resource_dispatcher_host_browsertest.cc » ('j') | content/child/web_url_loader_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698