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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 // Note: OTR mode never saves InitialNavigationHistory data. | 511 // Note: OTR mode never saves InitialNavigationHistory data. |
512 predictor_->Predictor::DiscardAllResults(); | 512 predictor_->Predictor::DiscardAllResults(); |
513 } | 513 } |
514 | 514 |
515 // Clear the host cache to avoid showing entries from the OTR session | 515 // Clear the host cache to avoid showing entries from the OTR session |
516 // in about:net-internals. | 516 // in about:net-internals. |
517 ClearHostCache(); | 517 ClearHostCache(); |
518 | 518 |
519 // Clear all of the passively logged data. | 519 // Clear all of the passively logged data. |
520 // TODO(eroman): this is a bit heavy handed, really all we need to do is | 520 // TODO(eroman): this is a bit heavy handed, really all we need to do is |
521 // clear the data pertaining to off the record context. | 521 // clear the data pertaining to incognito context. |
522 net_log_->ClearAllPassivelyCapturedEvents(); | 522 net_log_->ClearAllPassivelyCapturedEvents(); |
523 } | 523 } |
524 | 524 |
525 void IOThread::ClearHostCache() { | 525 void IOThread::ClearHostCache() { |
526 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 526 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
527 | 527 |
528 if (globals_->host_resolver->GetAsHostResolverImpl()) { | 528 if (globals_->host_resolver->GetAsHostResolverImpl()) { |
529 net::HostCache* host_cache = | 529 net::HostCache* host_cache = |
530 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); | 530 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); |
531 if (host_cache) | 531 if (host_cache) |
532 host_cache->clear(); | 532 host_cache->clear(); |
533 } | 533 } |
534 } | 534 } |
OLD | NEW |