Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: chrome/browser/custom_handlers/protocol_handler_registry.cc

Issue 11931024: Removed static factories for data, ftp, file, and about jobs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync (r198785) Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 878
873 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 879 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
874 ProtocolHandlerRegistry::CreateJobInterceptorFactory() { 880 ProtocolHandlerRegistry::CreateJobInterceptorFactory() {
875 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 881 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
876 // this is always created on the UI thread (in profile_io's 882 // this is always created on the UI thread (in profile_io's
877 // InitializeOnUIThread. Any method calls must be done 883 // InitializeOnUIThread. Any method calls must be done
878 // on the IO thread (this is checked). 884 // on the IO thread (this is checked).
879 return scoped_ptr<JobInterceptorFactory>(new JobInterceptorFactory( 885 return scoped_ptr<JobInterceptorFactory>(new JobInterceptorFactory(
880 io_thread_delegate_)); 886 io_thread_delegate_));
881 } 887 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698