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); | |
212 } | |
213 | |
214 // DefaultClientObserver ------------------------------------------------------ | 208 // DefaultClientObserver ------------------------------------------------------ |
215 | 209 |
216 ProtocolHandlerRegistry::DefaultClientObserver::DefaultClientObserver( | 210 ProtocolHandlerRegistry::DefaultClientObserver::DefaultClientObserver( |
217 ProtocolHandlerRegistry* registry) | 211 ProtocolHandlerRegistry* registry) |
218 : worker_(NULL), | 212 : worker_(NULL), |
219 registry_(registry) { | 213 registry_(registry) { |
220 DCHECK(registry_); | 214 DCHECK(registry_); |
221 } | 215 } |
222 | 216 |
223 ProtocolHandlerRegistry::DefaultClientObserver::~DefaultClientObserver() { | 217 ProtocolHandlerRegistry::DefaultClientObserver::~DefaultClientObserver() { |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 | 870 |
877 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 871 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
878 ProtocolHandlerRegistry::CreateJobInterceptorFactory() { | 872 ProtocolHandlerRegistry::CreateJobInterceptorFactory() { |
879 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 873 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
880 // this is always created on the UI thread (in profile_io's | 874 // this is always created on the UI thread (in profile_io's |
881 // InitializeOnUIThread. Any method calls must be done | 875 // InitializeOnUIThread. Any method calls must be done |
882 // on the IO thread (this is checked). | 876 // on the IO thread (this is checked). |
883 return scoped_ptr<JobInterceptorFactory>(new JobInterceptorFactory( | 877 return scoped_ptr<JobInterceptorFactory>(new JobInterceptorFactory( |
884 io_thread_delegate_)); | 878 io_thread_delegate_)); |
885 } | 879 } |
OLD | NEW |