| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |