| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/safe_browsing/safe_browsing_service.h" | 5 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 UMA_HISTOGRAM_LONG_TIMES("SB2.Delay", time); | 604 UMA_HISTOGRAM_LONG_TIMES("SB2.Delay", time); |
| 605 } | 605 } |
| 606 | 606 |
| 607 void SafeBrowsingService::InitURLRequestContextOnIOThread( | 607 void SafeBrowsingService::InitURLRequestContextOnIOThread( |
| 608 net::URLRequestContextGetter* system_url_request_context_getter) { | 608 net::URLRequestContextGetter* system_url_request_context_getter) { |
| 609 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 609 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 610 DCHECK(!url_request_context_.get()); | 610 DCHECK(!url_request_context_.get()); |
| 611 | 611 |
| 612 scoped_refptr<net::CookieStore> cookie_store = new net::CookieMonster( | 612 scoped_refptr<net::CookieStore> cookie_store = new net::CookieMonster( |
| 613 new SQLitePersistentCookieStore( | 613 new SQLitePersistentCookieStore( |
| 614 FilePath(BaseFilename().value() + kCookiesFile), false), | 614 FilePath(BaseFilename().value() + kCookiesFile), false, NULL), |
| 615 NULL); | 615 NULL); |
| 616 | 616 |
| 617 url_request_context_.reset(new SafeBrowsingURLRequestContext); | 617 url_request_context_.reset(new SafeBrowsingURLRequestContext); |
| 618 // |system_url_request_context_getter| may be NULL during tests. | 618 // |system_url_request_context_getter| may be NULL during tests. |
| 619 if (system_url_request_context_getter) | 619 if (system_url_request_context_getter) |
| 620 url_request_context_->CopyFrom( | 620 url_request_context_->CopyFrom( |
| 621 system_url_request_context_getter->GetURLRequestContext()); | 621 system_url_request_context_getter->GetURLRequestContext()); |
| 622 url_request_context_->set_cookie_store(cookie_store); | 622 url_request_context_->set_cookie_store(cookie_store); |
| 623 } | 623 } |
| 624 | 624 |
| (...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1425 Stop(); | 1425 Stop(); |
| 1426 | 1426 |
| 1427 if (csd_service_.get()) | 1427 if (csd_service_.get()) |
| 1428 csd_service_->SetEnabledAndRefreshState(enable); | 1428 csd_service_->SetEnabledAndRefreshState(enable); |
| 1429 if (download_service_.get()) { | 1429 if (download_service_.get()) { |
| 1430 download_service_->SetEnabled( | 1430 download_service_->SetEnabled( |
| 1431 enable && !CommandLine::ForCurrentProcess()->HasSwitch( | 1431 enable && !CommandLine::ForCurrentProcess()->HasSwitch( |
| 1432 switches::kDisableImprovedDownloadProtection)); | 1432 switches::kDisableImprovedDownloadProtection)); |
| 1433 } | 1433 } |
| 1434 } | 1434 } |
| OLD | NEW |