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

Side by Side Diff: chrome/browser/profiles/profile_impl_io_data.cc

Issue 10836248: Turned job_factory into a pure virtual class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits Created 8 years, 4 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/profiles/profile_impl_io_data.h" 5 #include "chrome/browser/profiles/profile_impl_io_data.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 18 matching lines...) Expand all
29 #include "chrome/common/pref_names.h" 29 #include "chrome/common/pref_names.h"
30 #include "chrome/common/url_constants.h" 30 #include "chrome/common/url_constants.h"
31 #include "content/public/browser/browser_thread.h" 31 #include "content/public/browser/browser_thread.h"
32 #include "content/public/browser/notification_service.h" 32 #include "content/public/browser/notification_service.h"
33 #include "content/public/browser/resource_context.h" 33 #include "content/public/browser/resource_context.h"
34 #include "net/base/server_bound_cert_service.h" 34 #include "net/base/server_bound_cert_service.h"
35 #include "net/ftp/ftp_network_layer.h" 35 #include "net/ftp/ftp_network_layer.h"
36 #include "net/http/http_cache.h" 36 #include "net/http/http_cache.h"
37 #include "net/url_request/file_protocol_handler.h" 37 #include "net/url_request/file_protocol_handler.h"
38 #include "net/url_request/ftp_protocol_handler.h" 38 #include "net/url_request/ftp_protocol_handler.h"
39 #include "net/url_request/url_request_job_factory.h" 39 #include "net/url_request/url_request_job_factory_impl.h"
40 #include "webkit/quota/special_storage_policy.h" 40 #include "webkit/quota/special_storage_policy.h"
41 41
42 using content::BrowserThread; 42 using content::BrowserThread;
43 43
44 ProfileImplIOData::Handle::Handle(Profile* profile) 44 ProfileImplIOData::Handle::Handle(Profile* profile)
45 : io_data_(new ProfileImplIOData), 45 : io_data_(new ProfileImplIOData),
46 profile_(profile), 46 profile_(profile),
47 initialized_(false) { 47 initialized_(false) {
48 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 48 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
49 DCHECK(profile); 49 DCHECK(profile);
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); 443 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get()));
444 main_context->set_ftp_transaction_factory(ftp_factory_.get()); 444 main_context->set_ftp_transaction_factory(ftp_factory_.get());
445 445
446 main_context->set_chrome_url_data_manager_backend( 446 main_context->set_chrome_url_data_manager_backend(
447 chrome_url_data_manager_backend()); 447 chrome_url_data_manager_backend());
448 448
449 // Create a media request context based on the main context, but using a 449 // Create a media request context based on the main context, but using a
450 // media cache. 450 // media cache.
451 media_request_context_.reset(InitializeMediaRequestContext(main_context, "")); 451 media_request_context_.reset(InitializeMediaRequestContext(main_context, ""));
452 452
453 main_job_factory_.reset(new net::URLRequestJobFactory); 453 main_job_factory_.reset(new net::URLRequestJobFactoryImpl);
454 media_request_job_factory_.reset(new net::URLRequestJobFactory); 454 media_request_job_factory_.reset(new net::URLRequestJobFactoryImpl);
455 extensions_job_factory_.reset(new net::URLRequestJobFactory); 455 extensions_job_factory_.reset(new net::URLRequestJobFactoryImpl);
456 456
457 int set_protocol = main_job_factory_->SetProtocolHandler( 457 int set_protocol = main_job_factory_->SetProtocolHandler(
458 chrome::kFileScheme, new net::FileProtocolHandler(network_delegate())); 458 chrome::kFileScheme, new net::FileProtocolHandler(network_delegate()));
459 DCHECK(set_protocol); 459 DCHECK(set_protocol);
460 set_protocol = media_request_job_factory_->SetProtocolHandler( 460 set_protocol = media_request_job_factory_->SetProtocolHandler(
461 chrome::kFileScheme, new net::FileProtocolHandler(network_delegate())); 461 chrome::kFileScheme, new net::FileProtocolHandler(network_delegate()));
462 DCHECK(set_protocol); 462 DCHECK(set_protocol);
463 // TODO(shalev): Without a network_delegate this protocol handler will never 463 // TODO(shalev): Without a network_delegate this protocol handler will never
464 // handle file: requests, but as a side effect it makes 464 // handle file: requests, but as a side effect it makes
465 // job_factory::IsHandledProtocol return true, which prevents attempts to 465 // job_factory::IsHandledProtocol return true, which prevents attempts to
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( 667 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread(
668 base::Time time) { 668 base::Time time) {
669 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 669 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
670 LazyInitialize(); 670 LazyInitialize();
671 671
672 DCHECK(transport_security_state()); 672 DCHECK(transport_security_state());
673 transport_security_state()->DeleteSince(time); 673 transport_security_state()->DeleteSince(time);
674 DCHECK(http_server_properties_manager()); 674 DCHECK(http_server_properties_manager());
675 http_server_properties_manager()->Clear(); 675 http_server_properties_manager()->Clear();
676 } 676 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698