Chromium Code Reviews| 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/io_thread.h" | 5 #include "chrome/browser/io_thread.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/leak_tracker.h" | 10 #include "base/debug/leak_tracker.h" |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 432 speculative_interceptor_ = NULL; | 432 speculative_interceptor_ = NULL; |
| 433 | 433 |
| 434 // TODO(eroman): hack for http://crbug.com/15513 | 434 // TODO(eroman): hack for http://crbug.com/15513 |
| 435 if (globals_->host_resolver->GetAsHostResolverImpl()) { | 435 if (globals_->host_resolver->GetAsHostResolverImpl()) { |
| 436 globals_->host_resolver.get()->GetAsHostResolverImpl()->Shutdown(); | 436 globals_->host_resolver.get()->GetAsHostResolverImpl()->Shutdown(); |
| 437 } | 437 } |
| 438 | 438 |
| 439 delete globals_; | 439 delete globals_; |
| 440 globals_ = NULL; | 440 globals_ = NULL; |
| 441 | 441 |
| 442 // net::URLRequest instances must NOT outlive the IO thread. | |
| 443 base::debug::LeakTracker<net::URLRequest>::CheckForLeaks(); | |
|
eroman
2011/03/02 02:23:31
What has changed to make this safe?
If I remember
willchan no longer on Chromium
2011/03/02 05:31:16
http://code.google.com/p/chromium/issues/detail?id
| |
| 444 | |
| 445 // This will delete the |notification_service_|. Make sure it's done after | |
| 446 // anything else can reference it. | |
| 442 BrowserProcessSubThread::CleanUp(); | 447 BrowserProcessSubThread::CleanUp(); |
| 443 } | 448 } |
| 444 | 449 |
| 445 void IOThread::CleanUpAfterMessageLoopDestruction() { | |
| 446 // This will delete the |notification_service_|. Make sure it's done after | |
| 447 // anything else can reference it. | |
| 448 BrowserProcessSubThread::CleanUpAfterMessageLoopDestruction(); | |
| 449 | |
| 450 // net::URLRequest instances must NOT outlive the IO thread. | |
| 451 // | |
| 452 // To allow for URLRequests to be deleted from | |
| 453 // MessageLoop::DestructionObserver this check has to happen after CleanUp | |
| 454 // (which runs before DestructionObservers). | |
| 455 base::debug::LeakTracker<net::URLRequest>::CheckForLeaks(); | |
| 456 } | |
| 457 | |
| 458 // static | 450 // static |
| 459 void IOThread::RegisterPrefs(PrefService* local_state) { | 451 void IOThread::RegisterPrefs(PrefService* local_state) { |
| 460 local_state->RegisterStringPref(prefs::kAuthSchemes, | 452 local_state->RegisterStringPref(prefs::kAuthSchemes, |
| 461 "basic,digest,ntlm,negotiate"); | 453 "basic,digest,ntlm,negotiate"); |
| 462 local_state->RegisterBooleanPref(prefs::kDisableAuthNegotiateCnameLookup, | 454 local_state->RegisterBooleanPref(prefs::kDisableAuthNegotiateCnameLookup, |
| 463 false); | 455 false); |
| 464 local_state->RegisterBooleanPref(prefs::kEnableAuthNegotiatePort, false); | 456 local_state->RegisterBooleanPref(prefs::kEnableAuthNegotiatePort, false); |
| 465 local_state->RegisterStringPref(prefs::kAuthServerWhitelist, ""); | 457 local_state->RegisterStringPref(prefs::kAuthServerWhitelist, ""); |
| 466 local_state->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, ""); | 458 local_state->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, ""); |
| 467 local_state->RegisterStringPref(prefs::kGSSAPILibraryName, ""); | 459 local_state->RegisterStringPref(prefs::kGSSAPILibraryName, ""); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 542 void IOThread::ClearHostCache() { | 534 void IOThread::ClearHostCache() { |
| 543 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 535 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 544 | 536 |
| 545 if (globals_->host_resolver->GetAsHostResolverImpl()) { | 537 if (globals_->host_resolver->GetAsHostResolverImpl()) { |
| 546 net::HostCache* host_cache = | 538 net::HostCache* host_cache = |
| 547 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); | 539 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); |
| 548 if (host_cache) | 540 if (host_cache) |
| 549 host_cache->clear(); | 541 host_cache->clear(); |
| 550 } | 542 } |
| 551 } | 543 } |
| OLD | NEW |