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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 request_manager_(new WebDataRequestManager()), | 83 request_manager_(new WebDataRequestManager()), |
84 app_locale_(AutofillCountry::ApplicationLocale()), | 84 app_locale_(AutofillCountry::ApplicationLocale()), |
85 autocomplete_syncable_service_(NULL), | 85 autocomplete_syncable_service_(NULL), |
86 autofill_profile_syncable_service_(NULL), | 86 autofill_profile_syncable_service_(NULL), |
87 failed_init_(false), | 87 failed_init_(false), |
88 should_commit_(false), | 88 should_commit_(false), |
89 main_loop_(MessageLoop::current()) { | 89 main_loop_(MessageLoop::current()) { |
90 // WebDataService requires DB thread if instantiated. | 90 // WebDataService requires DB thread if instantiated. |
91 // Set WebDataServiceFactory::GetInstance()->SetTestingFactory(&profile, NULL) | 91 // Set WebDataServiceFactory::GetInstance()->SetTestingFactory(&profile, NULL) |
92 // if you do not want to instantiate WebDataService in your test. | 92 // if you do not want to instantiate WebDataService in your test. |
93 DCHECK(!ProfileManager::IsImportProcess(*CommandLine::ForCurrentProcess())); | 93 CHECK(!ProfileManager::IsImportProcess(*CommandLine::ForCurrentProcess())); |
Peter Kasting
2013/02/22 21:34:55
CHECK means "Chrome has to crash immediately if th
| |
94 DCHECK(BrowserThread::IsWellKnownThread(BrowserThread::DB)); | 94 DCHECK(BrowserThread::IsWellKnownThread(BrowserThread::DB)); |
95 } | 95 } |
96 | 96 |
97 // static | 97 // static |
98 void WebDataService::NotifyOfMultipleAutofillChanges( | 98 void WebDataService::NotifyOfMultipleAutofillChanges( |
99 WebDataService* web_data_service) { | 99 WebDataService* web_data_service) { |
100 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 100 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
101 | 101 |
102 if (!web_data_service) | 102 if (!web_data_service) |
103 return; | 103 return; |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
948 | 948 |
949 void WebDataService::DestroyAutofillCreditCardResult( | 949 void WebDataService::DestroyAutofillCreditCardResult( |
950 const WDTypedResult* result) { | 950 const WDTypedResult* result) { |
951 DCHECK(result->GetType() == AUTOFILL_CREDITCARDS_RESULT); | 951 DCHECK(result->GetType() == AUTOFILL_CREDITCARDS_RESULT); |
952 const WDResult<std::vector<CreditCard*> >* r = | 952 const WDResult<std::vector<CreditCard*> >* r = |
953 static_cast<const WDResult<std::vector<CreditCard*> >*>(result); | 953 static_cast<const WDResult<std::vector<CreditCard*> >*>(result); |
954 | 954 |
955 std::vector<CreditCard*> credit_cards = r->GetValue(); | 955 std::vector<CreditCard*> credit_cards = r->GetValue(); |
956 STLDeleteElements(&credit_cards); | 956 STLDeleteElements(&credit_cards); |
957 } | 957 } |
OLD | NEW |