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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 297973002: Navigation transitions: Block first response until after transitions have run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 6 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" 7 #include "content/browser/loader/resource_dispatcher_host_impl.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 void ResourceDispatcherHostImpl::AddResourceContext(ResourceContext* context) { 380 void ResourceDispatcherHostImpl::AddResourceContext(ResourceContext* context) {
381 active_resource_contexts_.insert(context); 381 active_resource_contexts_.insert(context);
382 } 382 }
383 383
384 void ResourceDispatcherHostImpl::RemoveResourceContext( 384 void ResourceDispatcherHostImpl::RemoveResourceContext(
385 ResourceContext* context) { 385 ResourceContext* context) {
386 CHECK(ContainsKey(active_resource_contexts_, context)); 386 CHECK(ContainsKey(active_resource_contexts_, context));
387 active_resource_contexts_.erase(context); 387 active_resource_contexts_.erase(context);
388 } 388 }
389 389
390 void ResourceDispatcherHostImpl::ResumeResponseDeferredAtStart(
391 const GlobalRequestID& id) {
392 ResourceLoader* loader = GetLoader(id);
393 if (loader) {
394 // The response we were meant to resume could have already been canceled.
395 ResourceRequestInfoImpl* info = loader->GetRequestInfo();
396 if (info->cross_site_handler())
397 info->cross_site_handler()->ResumeResponseDeferredAtStart(id.request_id);
398 }
399 }
400
390 void ResourceDispatcherHostImpl::CancelRequestsForContext( 401 void ResourceDispatcherHostImpl::CancelRequestsForContext(
391 ResourceContext* context) { 402 ResourceContext* context) {
392 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 403 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
393 DCHECK(context); 404 DCHECK(context);
394 405
395 CHECK(ContainsKey(active_resource_contexts_, context)); 406 CHECK(ContainsKey(active_resource_contexts_, context));
396 407
397 // Note that request cancellation has side effects. Therefore, we gather all 408 // Note that request cancellation has side effects. Therefore, we gather all
398 // the requests to cancel first, and then we start cancelling. We assert at 409 // the requests to cancel first, and then we start cancelling. We assert at
399 // the end that there are no more to cancel since the context is about to go 410 // the end that there are no more to cancel since the context is about to go
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1973 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) 1984 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS)
1974 && !policy->CanReadRawCookies(child_id)) { 1985 && !policy->CanReadRawCookies(child_id)) {
1975 VLOG(1) << "Denied unauthorized request for raw headers"; 1986 VLOG(1) << "Denied unauthorized request for raw headers";
1976 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; 1987 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS;
1977 } 1988 }
1978 1989
1979 return load_flags; 1990 return load_flags;
1980 } 1991 }
1981 1992
1982 } // namespace content 1993 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.h ('k') | content/browser/renderer_host/render_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698