| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_IO_THREAD_H_ | 5 #ifndef CHROME_BROWSER_IO_THREAD_H_ |
| 6 #define CHROME_BROWSER_IO_THREAD_H_ | 6 #define CHROME_BROWSER_IO_THREAD_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 size_t max_concurrent, | 54 size_t max_concurrent, |
| 55 const chrome_common_net::NameList& hostnames_to_prefetch, | 55 const chrome_common_net::NameList& hostnames_to_prefetch, |
| 56 ListValue* referral_list); | 56 ListValue* referral_list); |
| 57 | 57 |
| 58 // Handles changing to On The Record mode. Posts a task for this onto the | 58 // Handles changing to On The Record mode. Posts a task for this onto the |
| 59 // IOThread's message loop. | 59 // IOThread's message loop. |
| 60 void ChangedToOnTheRecord(); | 60 void ChangedToOnTheRecord(); |
| 61 | 61 |
| 62 protected: | 62 protected: |
| 63 virtual void Init(); | 63 virtual void Init(); |
| 64 virtual void CleanUp(); |
| 64 virtual void CleanUpAfterMessageLoopDestruction(); | 65 virtual void CleanUpAfterMessageLoopDestruction(); |
| 65 | 66 |
| 66 private: | 67 private: |
| 67 net::HttpAuthHandlerFactory* CreateDefaultAuthHandlerFactory(); | 68 net::HttpAuthHandlerFactory* CreateDefaultAuthHandlerFactory(); |
| 68 | 69 |
| 69 void InitDnsMasterOnIOThread( | 70 void InitDnsMasterOnIOThread( |
| 70 bool prefetching_enabled, | 71 bool prefetching_enabled, |
| 71 base::TimeDelta max_queue_delay, | 72 base::TimeDelta max_queue_delay, |
| 72 size_t max_concurrent, | 73 size_t max_concurrent, |
| 73 chrome_common_net::NameList hostnames_to_prefetch, | 74 chrome_common_net::NameList hostnames_to_prefetch, |
| 74 ListValue* referral_list); | 75 ListValue* referral_list); |
| 75 | 76 |
| 76 void ChangedToOnTheRecordOnIOThread(); | 77 void ChangedToOnTheRecordOnIOThread(); |
| 77 | 78 |
| 78 // These member variables are basically global, but their lifetimes are tied | 79 // These member variables are basically global, but their lifetimes are tied |
| 79 // to the IOThread. IOThread owns them all, despite not using scoped_ptr. | 80 // to the IOThread. IOThread owns them all, despite not using scoped_ptr. |
| 80 // This is because the destructor of IOThread runs on the wrong thread. All | 81 // This is because the destructor of IOThread runs on the wrong thread. All |
| 81 // member variables should be deleted in CleanUp(). | 82 // member variables should be deleted in CleanUp(), except ChromeNetLog |
| 83 // which is deleted later in CleanUpAfterMessageLoopDestruction(). |
| 82 | 84 |
| 83 // These member variables are initialized in Init() and do not change for the | 85 // These member variables are initialized in Init() and do not change for the |
| 84 // lifetime of the IO thread. | 86 // lifetime of the IO thread. |
| 85 | 87 |
| 86 Globals* globals_; | 88 Globals* globals_; |
| 87 | 89 |
| 90 // This variable is only meaningful during shutdown. It is used to defer |
| 91 // deletion of the NetLog to CleanUpAfterMessageLoopDestruction() even |
| 92 // though |globals_| is reset by CleanUp(). |
| 93 scoped_ptr<ChromeNetLog> deferred_net_log_to_delete_; |
| 94 |
| 88 // These member variables are initialized by a task posted to the IO thread, | 95 // These member variables are initialized by a task posted to the IO thread, |
| 89 // which gets posted by calling certain member functions of IOThread. | 96 // which gets posted by calling certain member functions of IOThread. |
| 90 | 97 |
| 91 net::HostResolver::Observer* prefetch_observer_; | 98 net::HostResolver::Observer* prefetch_observer_; |
| 92 chrome_browser_net::DnsMaster* dns_master_; | 99 chrome_browser_net::DnsMaster* dns_master_; |
| 93 | 100 |
| 94 DISALLOW_COPY_AND_ASSIGN(IOThread); | 101 DISALLOW_COPY_AND_ASSIGN(IOThread); |
| 95 }; | 102 }; |
| 96 | 103 |
| 97 #endif // CHROME_BROWSER_IO_THREAD_H_ | 104 #endif // CHROME_BROWSER_IO_THREAD_H_ |
| OLD | NEW |