OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/net/predictor.h" | 5 #include "chrome/browser/net/predictor.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <set> | 9 #include <set> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 SaveDnsPrefetchStateForNextStartupAndTrimOnIOThread( | 792 SaveDnsPrefetchStateForNextStartupAndTrimOnIOThread( |
793 update_startup_list.Get(), | 793 update_startup_list.Get(), |
794 update_referral_list.Get(), | 794 update_referral_list.Get(), |
795 &completion, | 795 &completion, |
796 this); | 796 this); |
797 } else { | 797 } else { |
798 bool posted = BrowserThread::PostTask( | 798 bool posted = BrowserThread::PostTask( |
799 BrowserThread::IO, | 799 BrowserThread::IO, |
800 FROM_HERE, | 800 FROM_HERE, |
801 base::Bind( | 801 base::Bind( |
802 SaveDnsPrefetchStateForNextStartupAndTrimOnIOThread, | 802 &SaveDnsPrefetchStateForNextStartupAndTrimOnIOThread, |
803 update_startup_list.Get(), | 803 update_startup_list.Get(), |
804 update_referral_list.Get(), | 804 update_referral_list.Get(), |
805 &completion, | 805 &completion, |
806 this)); | 806 this)); |
807 | 807 |
808 // TODO(jar): Synchronous waiting for the IO thread is a potential source | 808 // TODO(jar): Synchronous waiting for the IO thread is a potential source |
809 // to deadlocks and should be investigated. See http://crbug.com/78451. | 809 // to deadlocks and should be investigated. See http://crbug.com/78451. |
810 DCHECK(posted); | 810 DCHECK(posted); |
811 if (posted) | 811 if (posted) |
812 completion.Wait(); | 812 completion.Wait(); |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 PrefService* local_state, | 1205 PrefService* local_state, |
1206 IOThread* io_thread) { | 1206 IOThread* io_thread) { |
1207 // Empty function for unittests. | 1207 // Empty function for unittests. |
1208 } | 1208 } |
1209 | 1209 |
1210 void SimplePredictor::ShutdownOnUIThread(PrefService* user_prefs) { | 1210 void SimplePredictor::ShutdownOnUIThread(PrefService* user_prefs) { |
1211 SetShutdown(true); | 1211 SetShutdown(true); |
1212 } | 1212 } |
1213 | 1213 |
1214 } // namespace chrome_browser_net | 1214 } // namespace chrome_browser_net |
OLD | NEW |