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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 return NULL; | 298 return NULL; |
299 #endif | 299 #endif |
300 } | 300 } |
301 | 301 |
302 void SafeBrowsingService::InitURLRequestContextOnIOThread( | 302 void SafeBrowsingService::InitURLRequestContextOnIOThread( |
303 net::URLRequestContextGetter* system_url_request_context_getter) { | 303 net::URLRequestContextGetter* system_url_request_context_getter) { |
304 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 304 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
305 DCHECK(!url_request_context_.get()); | 305 DCHECK(!url_request_context_.get()); |
306 | 306 |
307 scoped_refptr<net::CookieStore> cookie_store = new net::CookieMonster( | 307 scoped_refptr<net::CookieStore> cookie_store = new net::CookieMonster( |
308 new SQLitePersistentCookieStore(CookieFilePath(), false, NULL), | 308 new SQLitePersistentCookieStore( |
| 309 CookieFilePath(), |
| 310 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
| 311 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), |
| 312 false, |
| 313 NULL), |
309 NULL); | 314 NULL); |
310 | 315 |
311 url_request_context_.reset(new net::URLRequestContext); | 316 url_request_context_.reset(new net::URLRequestContext); |
312 // |system_url_request_context_getter| may be NULL during tests. | 317 // |system_url_request_context_getter| may be NULL during tests. |
313 if (system_url_request_context_getter) { | 318 if (system_url_request_context_getter) { |
314 url_request_context_->CopyFrom( | 319 url_request_context_->CopyFrom( |
315 system_url_request_context_getter->GetURLRequestContext()); | 320 system_url_request_context_getter->GetURLRequestContext()); |
316 } | 321 } |
317 url_request_context_->set_cookie_store(cookie_store); | 322 url_request_context_->set_cookie_store(cookie_store); |
318 } | 323 } |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 #if defined(FULL_SAFE_BROWSING) | 486 #if defined(FULL_SAFE_BROWSING) |
482 if (csd_service_.get()) | 487 if (csd_service_.get()) |
483 csd_service_->SetEnabledAndRefreshState(enable); | 488 csd_service_->SetEnabledAndRefreshState(enable); |
484 if (download_service_.get()) { | 489 if (download_service_.get()) { |
485 download_service_->SetEnabled( | 490 download_service_->SetEnabled( |
486 enable && !CommandLine::ForCurrentProcess()->HasSwitch( | 491 enable && !CommandLine::ForCurrentProcess()->HasSwitch( |
487 switches::kDisableImprovedDownloadProtection)); | 492 switches::kDisableImprovedDownloadProtection)); |
488 } | 493 } |
489 #endif | 494 #endif |
490 } | 495 } |
OLD | NEW |