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_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "chrome/browser/transport_security_persister.h" | 38 #include "chrome/browser/transport_security_persister.h" |
39 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 39 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
40 #include "chrome/common/chrome_notification_types.h" | 40 #include "chrome/common/chrome_notification_types.h" |
41 #include "chrome/common/chrome_switches.h" | 41 #include "chrome/common/chrome_switches.h" |
42 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
43 #include "chrome/common/url_constants.h" | 43 #include "chrome/common/url_constants.h" |
44 #include "content/public/browser/browser_thread.h" | 44 #include "content/public/browser/browser_thread.h" |
45 #include "content/public/browser/host_zoom_map.h" | 45 #include "content/public/browser/host_zoom_map.h" |
46 #include "content/public/browser/notification_service.h" | 46 #include "content/public/browser/notification_service.h" |
47 #include "content/public/browser/resource_context.h" | 47 #include "content/public/browser/resource_context.h" |
48 #include "content/public/browser/resource_dispatcher_host.h" | |
49 #include "net/base/server_bound_cert_service.h" | 48 #include "net/base/server_bound_cert_service.h" |
50 #include "net/http/http_transaction_factory.h" | 49 #include "net/http/http_transaction_factory.h" |
51 #include "net/http/http_util.h" | 50 #include "net/http/http_util.h" |
52 #include "net/proxy/proxy_config_service_fixed.h" | 51 #include "net/proxy/proxy_config_service_fixed.h" |
53 #include "net/proxy/proxy_script_fetcher_impl.h" | 52 #include "net/proxy/proxy_script_fetcher_impl.h" |
54 #include "net/proxy/proxy_service.h" | 53 #include "net/proxy/proxy_service.h" |
55 #include "net/url_request/url_request.h" | 54 #include "net/url_request/url_request.h" |
56 | 55 |
57 #if defined(OS_CHROMEOS) | 56 #if defined(OS_CHROMEOS) |
58 #include "chrome/browser/chromeos/gview_request_interceptor.h" | 57 #include "chrome/browser/chromeos/gview_request_interceptor.h" |
59 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 58 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
60 #endif // defined(OS_CHROMEOS) | 59 #endif // defined(OS_CHROMEOS) |
61 | 60 |
62 using content::BrowserContext; | 61 using content::BrowserContext; |
63 using content::BrowserThread; | 62 using content::BrowserThread; |
64 using content::ResourceContext; | 63 using content::ResourceContext; |
65 using content::ResourceDispatcherHost; | |
66 | 64 |
67 namespace { | 65 namespace { |
68 | 66 |
69 // ---------------------------------------------------------------------------- | 67 // ---------------------------------------------------------------------------- |
70 // CookieMonster::Delegate implementation | 68 // CookieMonster::Delegate implementation |
71 // ---------------------------------------------------------------------------- | 69 // ---------------------------------------------------------------------------- |
72 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { | 70 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { |
73 public: | 71 public: |
74 explicit ChromeCookieMonsterDelegate( | 72 explicit ChromeCookieMonsterDelegate( |
75 const base::Callback<Profile*(void)>& profile_getter) | 73 const base::Callback<Profile*(void)>& profile_getter) |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 void ProfileIOData::ShutdownOnUIThread() { | 502 void ProfileIOData::ShutdownOnUIThread() { |
505 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 503 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
506 enable_referrers_.Destroy(); | 504 enable_referrers_.Destroy(); |
507 clear_local_state_on_exit_.Destroy(); | 505 clear_local_state_on_exit_.Destroy(); |
508 safe_browsing_enabled_.Destroy(); | 506 safe_browsing_enabled_.Destroy(); |
509 session_startup_pref_.Destroy(); | 507 session_startup_pref_.Destroy(); |
510 #if defined(ENABLE_CONFIGURATION_POLICY) | 508 #if defined(ENABLE_CONFIGURATION_POLICY) |
511 if (url_blacklist_manager_.get()) | 509 if (url_blacklist_manager_.get()) |
512 url_blacklist_manager_->ShutdownOnUIThread(); | 510 url_blacklist_manager_->ShutdownOnUIThread(); |
513 #endif | 511 #endif |
514 BrowserThread::PostTask( | |
515 BrowserThread::IO, FROM_HERE, | |
516 base::Bind( | |
517 &ResourceDispatcherHost::CancelRequestsForContext, | |
518 base::Unretained(ResourceDispatcherHost::Get()), | |
519 &resource_context_)); | |
520 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); | 512 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); |
521 if (!posted) | 513 if (!posted) |
522 delete this; | 514 delete this; |
523 } | 515 } |
524 | 516 |
525 void ProfileIOData::set_server_bound_cert_service( | 517 void ProfileIOData::set_server_bound_cert_service( |
526 net::ServerBoundCertService* server_bound_cert_service) const { | 518 net::ServerBoundCertService* server_bound_cert_service) const { |
527 server_bound_cert_service_.reset(server_bound_cert_service); | 519 server_bound_cert_service_.reset(server_bound_cert_service); |
528 } | 520 } |
OLD | NEW |