Chromium Code Reviews| 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 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 5 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 198 } | 198 } |
| 199 | 199 |
| 200 bool ProtocolHandlerRegistry::JobInterceptorFactory::IsHandledURL( | 200 bool ProtocolHandlerRegistry::JobInterceptorFactory::IsHandledURL( |
| 201 const GURL& url) const { | 201 const GURL& url) const { |
| 202 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 202 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 203 return (url.is_valid() && | 203 return (url.is_valid() && |
| 204 io_thread_delegate_->IsHandledProtocol(url.scheme())) || | 204 io_thread_delegate_->IsHandledProtocol(url.scheme())) || |
| 205 job_factory_->IsHandledURL(url); | 205 job_factory_->IsHandledURL(url); |
| 206 } | 206 } |
| 207 | 207 |
| 208 bool ProtocolHandlerRegistry::JobInterceptorFactory::IsSafeRedirectTarget( | |
| 209 const GURL& location) const { | |
| 210 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
| 211 return job_factory_->IsSafeRedirectTarget(location); | |
|
mmenke
2013/02/19 17:26:15
This seems weird to me. If io_thread_delegate_ ha
pauljensen
2013/02/20 15:13:27
So there are two ProtocolHandler classes and three
erikwright (departed)
2013/02/20 15:25:48
It is entirely reasonable to consider the Protocol
mmenke
2013/02/20 15:48:58
This all SGTM (Leaving it for another CL, separati
| |
| 212 } | |
| 213 | |
| 208 // DefaultClientObserver ------------------------------------------------------ | 214 // DefaultClientObserver ------------------------------------------------------ |
| 209 | 215 |
| 210 ProtocolHandlerRegistry::DefaultClientObserver::DefaultClientObserver( | 216 ProtocolHandlerRegistry::DefaultClientObserver::DefaultClientObserver( |
| 211 ProtocolHandlerRegistry* registry) | 217 ProtocolHandlerRegistry* registry) |
| 212 : worker_(NULL), | 218 : worker_(NULL), |
| 213 registry_(registry) { | 219 registry_(registry) { |
| 214 DCHECK(registry_); | 220 DCHECK(registry_); |
| 215 } | 221 } |
| 216 | 222 |
| 217 ProtocolHandlerRegistry::DefaultClientObserver::~DefaultClientObserver() { | 223 ProtocolHandlerRegistry::DefaultClientObserver::~DefaultClientObserver() { |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 870 | 876 |
| 871 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 877 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
| 872 ProtocolHandlerRegistry::CreateJobInterceptorFactory() { | 878 ProtocolHandlerRegistry::CreateJobInterceptorFactory() { |
| 873 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 879 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 874 // this is always created on the UI thread (in profile_io's | 880 // this is always created on the UI thread (in profile_io's |
| 875 // InitializeOnUIThread. Any method calls must be done | 881 // InitializeOnUIThread. Any method calls must be done |
| 876 // on the IO thread (this is checked). | 882 // on the IO thread (this is checked). |
| 877 return scoped_ptr<JobInterceptorFactory>(new JobInterceptorFactory( | 883 return scoped_ptr<JobInterceptorFactory>(new JobInterceptorFactory( |
| 878 io_thread_delegate_)); | 884 io_thread_delegate_)); |
| 879 } | 885 } |
| OLD | NEW |