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