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

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

Issue 10700117: Replaced static URLRequestFileJob factory with non-static protocol handler for File jobs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed merge 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 14 matching lines...) Expand all
25 #include "chrome/common/chrome_notification_types.h" 25 #include "chrome/common/chrome_notification_types.h"
26 #include "chrome/common/chrome_switches.h" 26 #include "chrome/common/chrome_switches.h"
27 #include "chrome/common/pref_names.h" 27 #include "chrome/common/pref_names.h"
28 #include "chrome/common/url_constants.h" 28 #include "chrome/common/url_constants.h"
29 #include "content/public/browser/browser_thread.h" 29 #include "content/public/browser/browser_thread.h"
30 #include "content/public/browser/notification_service.h" 30 #include "content/public/browser/notification_service.h"
31 #include "content/public/browser/resource_context.h" 31 #include "content/public/browser/resource_context.h"
32 #include "net/base/server_bound_cert_service.h" 32 #include "net/base/server_bound_cert_service.h"
33 #include "net/ftp/ftp_network_layer.h" 33 #include "net/ftp/ftp_network_layer.h"
34 #include "net/http/http_cache.h" 34 #include "net/http/http_cache.h"
35 #include "net/url_request/file_protocol_handler.h"
35 #include "net/url_request/ftp_protocol_handler.h" 36 #include "net/url_request/ftp_protocol_handler.h"
36 #include "net/url_request/url_request_job_factory.h" 37 #include "net/url_request/url_request_job_factory.h"
37 #include "webkit/quota/special_storage_policy.h" 38 #include "webkit/quota/special_storage_policy.h"
38 39
39 using content::BrowserThread; 40 using content::BrowserThread;
40 41
41 ProfileImplIOData::Handle::Handle(Profile* profile) 42 ProfileImplIOData::Handle::Handle(Profile* profile)
42 : io_data_(new ProfileImplIOData), 43 : io_data_(new ProfileImplIOData),
43 profile_(profile), 44 profile_(profile),
44 initialized_(false) { 45 initialized_(false) {
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 main_context->set_ftp_transaction_factory(ftp_factory_.get()); 443 main_context->set_ftp_transaction_factory(ftp_factory_.get());
443 media_request_context_->set_ftp_transaction_factory(ftp_factory_.get()); 444 media_request_context_->set_ftp_transaction_factory(ftp_factory_.get());
444 445
445 main_context->set_chrome_url_data_manager_backend( 446 main_context->set_chrome_url_data_manager_backend(
446 chrome_url_data_manager_backend()); 447 chrome_url_data_manager_backend());
447 448
448 main_job_factory_.reset(new net::URLRequestJobFactory); 449 main_job_factory_.reset(new net::URLRequestJobFactory);
449 media_request_job_factory_.reset(new net::URLRequestJobFactory); 450 media_request_job_factory_.reset(new net::URLRequestJobFactory);
450 extensions_job_factory_.reset(new net::URLRequestJobFactory); 451 extensions_job_factory_.reset(new net::URLRequestJobFactory);
451 452
453 int set_protocol = main_job_factory_->SetProtocolHandler(
454 chrome::kFileScheme, new net::FileProtocolHandler(network_delegate()));
455 DCHECK(set_protocol);
456 set_protocol = media_request_job_factory_->SetProtocolHandler(
457 chrome::kFileScheme, new net::FileProtocolHandler(network_delegate()));
458 DCHECK(set_protocol);
459 set_protocol = extensions_job_factory_->SetProtocolHandler(
460 chrome::kFileScheme, new net::FileProtocolHandler(NULL));
461 DCHECK(set_protocol);
462
452 net::URLRequestJobFactory* job_factories[3]; 463 net::URLRequestJobFactory* job_factories[3];
453 job_factories[0] = main_job_factory_.get(); 464 job_factories[0] = main_job_factory_.get();
454 job_factories[1] = media_request_job_factory_.get(); 465 job_factories[1] = media_request_job_factory_.get();
455 job_factories[2] = extensions_job_factory_.get(); 466 job_factories[2] = extensions_job_factory_.get();
456 467
457 net::FtpAuthCache* ftp_auth_caches[3]; 468 net::FtpAuthCache* ftp_auth_caches[3];
458 ftp_auth_caches[0] = main_context->ftp_auth_cache(); 469 ftp_auth_caches[0] = main_context->ftp_auth_cache();
459 ftp_auth_caches[1] = media_request_context_->ftp_auth_cache(); 470 ftp_auth_caches[1] = media_request_context_->ftp_auth_cache();
460 ftp_auth_caches[2] = extensions_context->ftp_auth_cache(); 471 ftp_auth_caches[2] = extensions_context->ftp_auth_cache();
461 472
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( 593 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread(
583 base::Time time) { 594 base::Time time) {
584 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 595 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
585 LazyInitialize(); 596 LazyInitialize();
586 597
587 DCHECK(transport_security_state()); 598 DCHECK(transport_security_state());
588 transport_security_state()->DeleteSince(time); 599 transport_security_state()->DeleteSince(time);
589 DCHECK(http_server_properties_manager()); 600 DCHECK(http_server_properties_manager());
590 http_server_properties_manager()->Clear(); 601 http_server_properties_manager()->Clear();
591 } 602 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698