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/io_thread.h" | 5 #include "chrome/browser/io_thread.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 static const char kInitialMaxConcurrentStreams[] = "init-max-streams"; | 684 static const char kInitialMaxConcurrentStreams[] = "init-max-streams"; |
685 | 685 |
686 std::vector<std::string> spdy_options; | 686 std::vector<std::string> spdy_options; |
687 base::SplitString(mode, ',', &spdy_options); | 687 base::SplitString(mode, ',', &spdy_options); |
688 | 688 |
689 for (std::vector<std::string>::iterator it = spdy_options.begin(); | 689 for (std::vector<std::string>::iterator it = spdy_options.begin(); |
690 it != spdy_options.end(); ++it) { | 690 it != spdy_options.end(); ++it) { |
691 const std::string& element = *it; | 691 const std::string& element = *it; |
692 std::vector<std::string> name_value; | 692 std::vector<std::string> name_value; |
693 base::SplitString(element, '=', &name_value); | 693 base::SplitString(element, '=', &name_value); |
694 const std::string& option = name_value.size() > 0 ? name_value[0] : ""; | 694 const std::string& option = |
695 const std::string value = name_value.size() > 1 ? name_value[1] : ""; | 695 name_value.size() > 0 ? name_value[0] : std::string(); |
| 696 const std::string value = |
| 697 name_value.size() > 1 ? name_value[1] : std::string(); |
696 | 698 |
697 if (option == kOff) { | 699 if (option == kOff) { |
698 net::HttpStreamFactory::set_spdy_enabled(false); | 700 net::HttpStreamFactory::set_spdy_enabled(false); |
699 } else if (option == kDisableSSL) { | 701 } else if (option == kDisableSSL) { |
700 globals_->spdy_default_protocol.set(net::kProtoSPDY2); | 702 globals_->spdy_default_protocol.set(net::kProtoSPDY2); |
701 net::HttpStreamFactory::set_force_spdy_over_ssl(false); | 703 net::HttpStreamFactory::set_force_spdy_over_ssl(false); |
702 net::HttpStreamFactory::set_force_spdy_always(true); | 704 net::HttpStreamFactory::set_force_spdy_always(true); |
703 } else if (option == kSSL) { | 705 } else if (option == kSSL) { |
704 globals_->spdy_default_protocol.set(net::kProtoSPDY2); | 706 globals_->spdy_default_protocol.set(net::kProtoSPDY2); |
705 net::HttpStreamFactory::set_force_spdy_over_ssl(true); | 707 net::HttpStreamFactory::set_force_spdy_over_ssl(true); |
(...skipping 26 matching lines...) Expand all Loading... |
732 } | 734 } |
733 } | 735 } |
734 | 736 |
735 // static | 737 // static |
736 void IOThread::RegisterPrefs(PrefRegistrySimple* registry) { | 738 void IOThread::RegisterPrefs(PrefRegistrySimple* registry) { |
737 registry->RegisterStringPref(prefs::kAuthSchemes, | 739 registry->RegisterStringPref(prefs::kAuthSchemes, |
738 "basic,digest,ntlm,negotiate," | 740 "basic,digest,ntlm,negotiate," |
739 "spdyproxy"); | 741 "spdyproxy"); |
740 registry->RegisterBooleanPref(prefs::kDisableAuthNegotiateCnameLookup, false); | 742 registry->RegisterBooleanPref(prefs::kDisableAuthNegotiateCnameLookup, false); |
741 registry->RegisterBooleanPref(prefs::kEnableAuthNegotiatePort, false); | 743 registry->RegisterBooleanPref(prefs::kEnableAuthNegotiatePort, false); |
742 registry->RegisterStringPref(prefs::kAuthServerWhitelist, ""); | 744 registry->RegisterStringPref(prefs::kAuthServerWhitelist, std::string()); |
743 registry->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, ""); | 745 registry->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, |
744 registry->RegisterStringPref(prefs::kGSSAPILibraryName, ""); | 746 std::string()); |
745 registry->RegisterStringPref(prefs::kSpdyProxyAuthOrigin, ""); | 747 registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string()); |
| 748 registry->RegisterStringPref(prefs::kSpdyProxyAuthOrigin, std::string()); |
746 registry->RegisterBooleanPref(prefs::kEnableReferrers, true); | 749 registry->RegisterBooleanPref(prefs::kEnableReferrers, true); |
747 registry->RegisterInt64Pref(prefs::kHttpReceivedContentLength, 0); | 750 registry->RegisterInt64Pref(prefs::kHttpReceivedContentLength, 0); |
748 registry->RegisterInt64Pref(prefs::kHttpOriginalContentLength, 0); | 751 registry->RegisterInt64Pref(prefs::kHttpOriginalContentLength, 0); |
749 #if defined(OS_ANDROID) || defined(OS_IOS) | 752 #if defined(OS_ANDROID) || defined(OS_IOS) |
750 registry->RegisterListPref(prefs::kDailyHttpOriginalContentLength); | 753 registry->RegisterListPref(prefs::kDailyHttpOriginalContentLength); |
751 registry->RegisterListPref(prefs::kDailyHttpReceivedContentLength); | 754 registry->RegisterListPref(prefs::kDailyHttpReceivedContentLength); |
752 registry->RegisterInt64Pref(prefs::kDailyHttpContentLengthLastUpdateDate, 0L); | 755 registry->RegisterInt64Pref(prefs::kDailyHttpContentLengthLastUpdateDate, 0L); |
753 #endif | 756 #endif |
754 registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, true); | 757 registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, true); |
755 } | 758 } |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 globals_->system_request_context.reset( | 907 globals_->system_request_context.reset( |
905 ConstructSystemRequestContext(globals_, net_log_)); | 908 ConstructSystemRequestContext(globals_, net_log_)); |
906 | 909 |
907 sdch_manager_->set_sdch_fetcher( | 910 sdch_manager_->set_sdch_fetcher( |
908 new SdchDictionaryFetcher(system_url_request_context_getter_.get())); | 911 new SdchDictionaryFetcher(system_url_request_context_getter_.get())); |
909 } | 912 } |
910 | 913 |
911 void IOThread::UpdateDnsClientEnabled() { | 914 void IOThread::UpdateDnsClientEnabled() { |
912 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); | 915 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); |
913 } | 916 } |
OLD | NEW |