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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 292 |
293 #if defined(FULL_SAFE_BROWSING) | 293 #if defined(FULL_SAFE_BROWSING) |
294 return new SafeBrowsingDatabaseManager(this); | 294 return new SafeBrowsingDatabaseManager(this); |
295 #else | 295 #else |
296 return NULL; | 296 return NULL; |
297 #endif | 297 #endif |
298 } | 298 } |
299 | 299 |
300 void SafeBrowsingService::InitURLRequestContextOnIOThread( | 300 void SafeBrowsingService::InitURLRequestContextOnIOThread( |
301 net::URLRequestContextGetter* system_url_request_context_getter) { | 301 net::URLRequestContextGetter* system_url_request_context_getter) { |
302 using content::CookieStoreConfig; | |
303 | |
304 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 302 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
305 DCHECK(!url_request_context_.get()); | 303 DCHECK(!url_request_context_.get()); |
306 | 304 |
307 scoped_refptr<net::CookieStore> cookie_store( | 305 scoped_refptr<net::CookieStore> cookie_store( |
308 CreateCookieStore( | 306 content::CreatePersistentCookieStore( |
309 CookieStoreConfig(CookieFilePath(), | 307 CookieFilePath(), |
310 CookieStoreConfig::EPHEMERAL_SESSION_COOKIES, | 308 false, |
311 NULL, NULL))); | 309 NULL, |
| 310 NULL)); |
312 | 311 |
313 url_request_context_.reset(new net::URLRequestContext); | 312 url_request_context_.reset(new net::URLRequestContext); |
314 // |system_url_request_context_getter| may be NULL during tests. | 313 // |system_url_request_context_getter| may be NULL during tests. |
315 if (system_url_request_context_getter) { | 314 if (system_url_request_context_getter) { |
316 url_request_context_->CopyFrom( | 315 url_request_context_->CopyFrom( |
317 system_url_request_context_getter->GetURLRequestContext()); | 316 system_url_request_context_getter->GetURLRequestContext()); |
318 } | 317 } |
319 url_request_context_->set_cookie_store(cookie_store.get()); | 318 url_request_context_->set_cookie_store(cookie_store.get()); |
320 } | 319 } |
321 | 320 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 #if defined(FULL_SAFE_BROWSING) | 480 #if defined(FULL_SAFE_BROWSING) |
482 if (csd_service_.get()) | 481 if (csd_service_.get()) |
483 csd_service_->SetEnabledAndRefreshState(enable); | 482 csd_service_->SetEnabledAndRefreshState(enable); |
484 if (download_service_.get()) { | 483 if (download_service_.get()) { |
485 download_service_->SetEnabled( | 484 download_service_->SetEnabled( |
486 enable && !CommandLine::ForCurrentProcess()->HasSwitch( | 485 enable && !CommandLine::ForCurrentProcess()->HasSwitch( |
487 switches::kDisableImprovedDownloadProtection)); | 486 switches::kDisableImprovedDownloadProtection)); |
488 } | 487 } |
489 #endif | 488 #endif |
490 } | 489 } |
OLD | NEW |