| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/chrome_url_request_context.h" | 5 #include "chrome/browser/net/chrome_url_request_context.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/privacy_blacklist/blacklist.h" | 10 #include "chrome/browser/privacy_blacklist/blacklist.h" |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 const std::string& default_charset) { | 513 const std::string& default_charset) { |
| 514 DCHECK(MessageLoop::current() == | 514 DCHECK(MessageLoop::current() == |
| 515 ChromeThread::GetMessageLoop(ChromeThread::IO)); | 515 ChromeThread::GetMessageLoop(ChromeThread::IO)); |
| 516 referrer_charset_ = default_charset; | 516 referrer_charset_ = default_charset; |
| 517 accept_charset_ = | 517 accept_charset_ = |
| 518 net::HttpUtil::GenerateAcceptCharsetHeader(default_charset); | 518 net::HttpUtil::GenerateAcceptCharsetHeader(default_charset); |
| 519 } | 519 } |
| 520 | 520 |
| 521 void ChromeURLRequestContext::OnNewExtensions(const std::string& id, | 521 void ChromeURLRequestContext::OnNewExtensions(const std::string& id, |
| 522 const FilePath& path) { | 522 const FilePath& path) { |
| 523 if (!is_off_the_record_) { | 523 if (!is_off_the_record_) |
| 524 extension_paths_[id] = path; | 524 extension_paths_[id] = path; |
| 525 } | |
| 526 } | 525 } |
| 527 | 526 |
| 528 void ChromeURLRequestContext::OnUnloadedExtension(const std::string& id) { | 527 void ChromeURLRequestContext::OnUnloadedExtension(const std::string& id) { |
| 529 if (is_off_the_record_) | 528 if (is_off_the_record_) |
| 530 return; | 529 return; |
| 531 ExtensionPaths::iterator iter = extension_paths_.find(id); | 530 ExtensionPaths::iterator iter = extension_paths_.find(id); |
| 532 DCHECK(iter != extension_paths_.end()); | 531 DCHECK(iter != extension_paths_.end()); |
| 533 extension_paths_.erase(iter); | 532 extension_paths_.erase(iter); |
| 534 } | 533 } |
| 535 | 534 |
| 536 ChromeURLRequestContext::~ChromeURLRequestContext() { | 535 ChromeURLRequestContext::~ChromeURLRequestContext() { |
| 537 DCHECK(NULL == prefs_); | 536 DCHECK(NULL == prefs_); |
| 538 | 537 |
| 539 if (appcache_service_.get() && appcache_service_->request_context() == this) | 538 if (appcache_service_.get() && appcache_service_->request_context() == this) |
| 540 appcache_service_->set_request_context(NULL); | 539 appcache_service_->set_request_context(NULL); |
| 541 | 540 |
| 542 NotificationService::current()->Notify( | 541 NotificationService::current()->Notify( |
| 543 NotificationType::URL_REQUEST_CONTEXT_RELEASED, | 542 NotificationType::URL_REQUEST_CONTEXT_RELEASED, |
| 544 Source<URLRequestContext>(this), | 543 Source<URLRequestContext>(this), |
| 545 NotificationService::NoDetails()); | 544 NotificationService::NoDetails()); |
| 546 | 545 |
| 547 delete ftp_transaction_factory_; | 546 delete ftp_transaction_factory_; |
| 548 delete http_transaction_factory_; | 547 delete http_transaction_factory_; |
| 549 } | 548 } |
| OLD | NEW |