Chromium Code Reviews| 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/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" |
| 11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 12 #include "base/threading/worker_pool.h" | 12 #include "base/threading/worker_pool.h" |
| 13 #include "chrome/browser/api/prefs/pref_member.h" | 13 #include "chrome/browser/api/prefs/pref_member.h" |
| 14 #include "chrome/browser/io_thread.h" | 14 #include "chrome/browser/io_thread.h" |
| 15 #include "chrome/browser/net/about_protocol_handler.h" | 15 #include "chrome/browser/net/about_protocol_handler.h" |
| 16 #include "chrome/browser/net/basic_http_user_agent_settings.h" | |
| 16 #include "chrome/browser/net/chrome_net_log.h" | 17 #include "chrome/browser/net/chrome_net_log.h" |
| 17 #include "chrome/browser/net/clear_on_exit_policy.h" | 18 #include "chrome/browser/net/clear_on_exit_policy.h" |
| 18 #include "chrome/browser/net/connect_interceptor.h" | 19 #include "chrome/browser/net/connect_interceptor.h" |
| 19 #include "chrome/browser/net/http_server_properties_manager.h" | 20 #include "chrome/browser/net/http_server_properties_manager.h" |
| 20 #include "chrome/browser/net/predictor.h" | 21 #include "chrome/browser/net/predictor.h" |
| 21 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" | 22 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" |
| 22 #include "chrome/browser/net/sqlite_server_bound_cert_store.h" | 23 #include "chrome/browser/net/sqlite_server_bound_cert_store.h" |
| 23 #include "chrome/browser/prefs/pref_service.h" | 24 #include "chrome/browser/prefs/pref_service.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 26 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 310 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 311 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 311 // Only allow Record Mode if we are in a Debug build or where we are running | 312 // Only allow Record Mode if we are in a Debug build or where we are running |
| 312 // a cycle, and the user has limited control. | 313 // a cycle, and the user has limited control. |
| 313 bool record_mode = command_line.HasSwitch(switches::kRecordMode) && | 314 bool record_mode = command_line.HasSwitch(switches::kRecordMode) && |
| 314 (chrome::kRecordModeEnabled || | 315 (chrome::kRecordModeEnabled || |
| 315 command_line.HasSwitch(switches::kVisitURLs)); | 316 command_line.HasSwitch(switches::kVisitURLs)); |
| 316 bool playback_mode = command_line.HasSwitch(switches::kPlaybackMode); | 317 bool playback_mode = command_line.HasSwitch(switches::kPlaybackMode); |
| 317 | 318 |
| 318 // Initialize context members. | 319 // Initialize context members. |
| 319 | 320 |
| 321 http_user_agent_settings_.reset(new BasicHttpUserAgentSettings( | |
|
erikwright (departed)
2012/09/21 15:06:33
I'm not certain, but I think that the main_context
| |
| 322 profile_params->accept_language, profile_params->accept_charset)); | |
| 323 main_context->set_http_user_agent_settings(http_user_agent_settings_.get()); | |
| 324 extensions_context->set_http_user_agent_settings( | |
| 325 http_user_agent_settings_.get()); | |
| 326 | |
| 320 ApplyProfileParamsToContext(main_context); | 327 ApplyProfileParamsToContext(main_context); |
| 321 ApplyProfileParamsToContext(extensions_context); | 328 ApplyProfileParamsToContext(extensions_context); |
| 322 | 329 |
| 323 if (http_server_properties_manager()) | 330 if (http_server_properties_manager()) |
| 324 http_server_properties_manager()->InitializeOnIOThread(); | 331 http_server_properties_manager()->InitializeOnIOThread(); |
| 325 | 332 |
| 326 main_context->set_transport_security_state(transport_security_state()); | 333 main_context->set_transport_security_state(transport_security_state()); |
| 327 extensions_context->set_transport_security_state(transport_security_state()); | 334 extensions_context->set_transport_security_state(transport_security_state()); |
| 328 | 335 |
| 329 main_context->set_net_log(io_thread->net_log()); | 336 main_context->set_net_log(io_thread->net_log()); |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 665 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( | 672 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( |
| 666 base::Time time) { | 673 base::Time time) { |
| 667 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 674 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 668 LazyInitialize(); | 675 LazyInitialize(); |
| 669 | 676 |
| 670 DCHECK(transport_security_state()); | 677 DCHECK(transport_security_state()); |
| 671 transport_security_state()->DeleteSince(time); | 678 transport_security_state()->DeleteSince(time); |
| 672 DCHECK(http_server_properties_manager()); | 679 DCHECK(http_server_properties_manager()); |
| 673 http_server_properties_manager()->Clear(); | 680 http_server_properties_manager()->Clear(); |
| 674 } | 681 } |
| OLD | NEW |