| 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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 ResourceRequestInfoImpl* info = loader->GetRequestInfo(); | 672 ResourceRequestInfoImpl* info = loader->GetRequestInfo(); |
| 673 | 673 |
| 674 if (!ResourceType::IsFrame(info->GetResourceType())) | 674 if (!ResourceType::IsFrame(info->GetResourceType())) |
| 675 return false; | 675 return false; |
| 676 | 676 |
| 677 const net::URLRequestJobFactory* job_factory = | 677 const net::URLRequestJobFactory* job_factory = |
| 678 info->GetContext()->GetRequestContext()->job_factory(); | 678 info->GetContext()->GetRequestContext()->job_factory(); |
| 679 if (job_factory->IsHandledURL(url)) | 679 if (job_factory->IsHandledURL(url)) |
| 680 return false; | 680 return false; |
| 681 | 681 |
| 682 bool initiated_by_user_gesture = | 682 return delegate_->HandleExternalProtocol( |
| 683 (loader->request()->load_flags() & net::LOAD_MAYBE_USER_GESTURE) != 0; | 683 url, info->GetChildID(), info->GetRouteID()); |
| 684 bool handled = delegate_->HandleExternalProtocol(url, info->GetChildID(), | |
| 685 info->GetRouteID(), | |
| 686 initiated_by_user_gesture); | |
| 687 // Consume the user gesture if the external protocol dialog is shown. | |
| 688 if (handled) | |
| 689 last_user_gesture_time_ = base::TimeTicks(); | |
| 690 return handled; | |
| 691 } | 684 } |
| 692 | 685 |
| 693 void ResourceDispatcherHostImpl::DidStartRequest(ResourceLoader* loader) { | 686 void ResourceDispatcherHostImpl::DidStartRequest(ResourceLoader* loader) { |
| 694 // Make sure we have the load state monitor running | 687 // Make sure we have the load state monitor running |
| 695 if (!update_load_states_timer_->IsRunning()) { | 688 if (!update_load_states_timer_->IsRunning()) { |
| 696 update_load_states_timer_->Start(FROM_HERE, | 689 update_load_states_timer_->Start(FROM_HERE, |
| 697 TimeDelta::FromMilliseconds(kUpdateLoadStatesIntervalMsec), | 690 TimeDelta::FromMilliseconds(kUpdateLoadStatesIntervalMsec), |
| 698 this, &ResourceDispatcherHostImpl::UpdateLoadStates); | 691 this, &ResourceDispatcherHostImpl::UpdateLoadStates); |
| 699 } | 692 } |
| 700 } | 693 } |
| (...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2034 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) | 2027 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) |
| 2035 && !policy->CanReadRawCookies(child_id)) { | 2028 && !policy->CanReadRawCookies(child_id)) { |
| 2036 VLOG(1) << "Denied unauthorized request for raw headers"; | 2029 VLOG(1) << "Denied unauthorized request for raw headers"; |
| 2037 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; | 2030 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; |
| 2038 } | 2031 } |
| 2039 | 2032 |
| 2040 return load_flags; | 2033 return load_flags; |
| 2041 } | 2034 } |
| 2042 | 2035 |
| 2043 } // namespace content | 2036 } // namespace content |
| OLD | NEW |