| 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/webdata/web_data_service.h" | 5 #include "chrome/browser/webdata/web_data_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 WDKeywordsResult::~WDKeywordsResult() {} | 78 WDKeywordsResult::~WDKeywordsResult() {} |
| 79 | 79 |
| 80 WebDataService::WebDataService(WebDatabaseService* wdbs) | 80 WebDataService::WebDataService(WebDatabaseService* wdbs) |
| 81 : wdbs_(wdbs), | 81 : wdbs_(wdbs), |
| 82 db_loaded_(false), | 82 db_loaded_(false), |
| 83 autocomplete_syncable_service_(NULL), | 83 autocomplete_syncable_service_(NULL), |
| 84 autofill_profile_syncable_service_(NULL) { | 84 autofill_profile_syncable_service_(NULL) { |
| 85 // WebDataService requires DB thread if instantiated. | 85 // WebDataService requires DB thread if instantiated. |
| 86 // Set WebDataServiceFactory::GetInstance()->SetTestingFactory(&profile, NULL) | 86 // Set WebDataServiceFactory::GetInstance()->SetTestingFactory(&profile, NULL) |
| 87 // if you do not want to instantiate WebDataService in your test. | 87 // if you do not want to instantiate WebDataService in your test. |
| 88 DCHECK(!ProfileManager::IsImportProcess(*CommandLine::ForCurrentProcess())); | |
| 89 DCHECK(BrowserThread::IsWellKnownThread(BrowserThread::DB)); | 88 DCHECK(BrowserThread::IsWellKnownThread(BrowserThread::DB)); |
| 90 } | 89 } |
| 91 | 90 |
| 92 // static | 91 // static |
| 93 void WebDataService::NotifyOfMultipleAutofillChanges( | 92 void WebDataService::NotifyOfMultipleAutofillChanges( |
| 94 WebDataService* web_data_service) { | 93 WebDataService* web_data_service) { |
| 95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
| 96 | 95 |
| 97 if (!web_data_service) | 96 if (!web_data_service) |
| 98 return; | 97 return; |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 void WebDataService::DestroyAutofillCreditCardResult( | 803 void WebDataService::DestroyAutofillCreditCardResult( |
| 805 const WDTypedResult* result) { | 804 const WDTypedResult* result) { |
| 806 DCHECK(result->GetType() == AUTOFILL_CREDITCARDS_RESULT); | 805 DCHECK(result->GetType() == AUTOFILL_CREDITCARDS_RESULT); |
| 807 const WDResult<std::vector<CreditCard*> >* r = | 806 const WDResult<std::vector<CreditCard*> >* r = |
| 808 static_cast<const WDResult<std::vector<CreditCard*> >*>(result); | 807 static_cast<const WDResult<std::vector<CreditCard*> >*>(result); |
| 809 | 808 |
| 810 std::vector<CreditCard*> credit_cards = r->GetValue(); | 809 std::vector<CreditCard*> credit_cards = r->GetValue(); |
| 811 STLDeleteElements(&credit_cards); | 810 STLDeleteElements(&credit_cards); |
| 812 } | 811 } |
| 813 | 812 |
| OLD | NEW |