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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 void ResourceDispatcherHostImpl::AddResourceContext(ResourceContext* context) { | 373 void ResourceDispatcherHostImpl::AddResourceContext(ResourceContext* context) { |
374 active_resource_contexts_.insert(context); | 374 active_resource_contexts_.insert(context); |
375 } | 375 } |
376 | 376 |
377 void ResourceDispatcherHostImpl::RemoveResourceContext( | 377 void ResourceDispatcherHostImpl::RemoveResourceContext( |
378 ResourceContext* context) { | 378 ResourceContext* context) { |
379 CHECK(ContainsKey(active_resource_contexts_, context)); | 379 CHECK(ContainsKey(active_resource_contexts_, context)); |
380 active_resource_contexts_.erase(context); | 380 active_resource_contexts_.erase(context); |
381 } | 381 } |
382 | 382 |
| 383 void ResourceDispatcherHostImpl::ResumeResponseDeferredAtStart( |
| 384 const GlobalRequestID& id) { |
| 385 ResourceLoader* loader = GetLoader(id); |
| 386 if (loader) { |
| 387 // The response we were meant to resume could have already been canceled. |
| 388 ResourceRequestInfoImpl* info = loader->GetRequestInfo(); |
| 389 if (info->cross_site_handler()) |
| 390 info->cross_site_handler()->ResumeResponseDeferredAtStart(id.request_id); |
| 391 } |
| 392 } |
| 393 |
383 void ResourceDispatcherHostImpl::CancelRequestsForContext( | 394 void ResourceDispatcherHostImpl::CancelRequestsForContext( |
384 ResourceContext* context) { | 395 ResourceContext* context) { |
385 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 396 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
386 DCHECK(context); | 397 DCHECK(context); |
387 | 398 |
388 CHECK(ContainsKey(active_resource_contexts_, context)); | 399 CHECK(ContainsKey(active_resource_contexts_, context)); |
389 | 400 |
390 // Note that request cancellation has side effects. Therefore, we gather all | 401 // Note that request cancellation has side effects. Therefore, we gather all |
391 // the requests to cancel first, and then we start cancelling. We assert at | 402 // the requests to cancel first, and then we start cancelling. We assert at |
392 // the end that there are no more to cancel since the context is about to go | 403 // the end that there are no more to cancel since the context is about to go |
(...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1972 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) | 1983 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) |
1973 && !policy->CanReadRawCookies(child_id)) { | 1984 && !policy->CanReadRawCookies(child_id)) { |
1974 VLOG(1) << "Denied unauthorized request for raw headers"; | 1985 VLOG(1) << "Denied unauthorized request for raw headers"; |
1975 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; | 1986 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; |
1976 } | 1987 } |
1977 | 1988 |
1978 return load_flags; | 1989 return load_flags; |
1979 } | 1990 } |
1980 | 1991 |
1981 } // namespace content | 1992 } // namespace content |
OLD | NEW |