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/sync/glue/typed_url_change_processor.h" | 5 #include "chrome/browser/sync/glue/typed_url_change_processor.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 static const int kTypedUrlVisitThrottleThreshold = 10; | 32 static const int kTypedUrlVisitThrottleThreshold = 10; |
33 | 33 |
34 // This is the multiple we use when throttling sync updates. If the multiple is | 34 // This is the multiple we use when throttling sync updates. If the multiple is |
35 // N, we sync up every Nth update (i.e. when typed_count % N == 0). | 35 // N, we sync up every Nth update (i.e. when typed_count % N == 0). |
36 static const int kTypedUrlVisitThrottleMultiple = 10; | 36 static const int kTypedUrlVisitThrottleMultiple = 10; |
37 | 37 |
38 TypedUrlChangeProcessor::TypedUrlChangeProcessor( | 38 TypedUrlChangeProcessor::TypedUrlChangeProcessor( |
39 Profile* profile, | 39 Profile* profile, |
40 TypedUrlModelAssociator* model_associator, | 40 TypedUrlModelAssociator* model_associator, |
41 history::HistoryBackend* history_backend, | 41 history::HistoryBackend* history_backend, |
42 DataTypeErrorHandler* error_handler) | 42 sync_driver::DataTypeErrorHandler* error_handler) |
43 : ChangeProcessor(error_handler), | 43 : sync_driver::ChangeProcessor(error_handler), |
44 profile_(profile), | 44 profile_(profile), |
45 model_associator_(model_associator), | 45 model_associator_(model_associator), |
46 history_backend_(history_backend), | 46 history_backend_(history_backend), |
47 backend_loop_(base::MessageLoop::current()), | 47 backend_loop_(base::MessageLoop::current()), |
48 disconnected_(false) { | 48 disconnected_(false) { |
49 DCHECK(model_associator); | 49 DCHECK(model_associator); |
50 DCHECK(history_backend); | 50 DCHECK(history_backend); |
51 DCHECK(error_handler); | 51 DCHECK(error_handler); |
52 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); | 52 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); |
53 // When running in unit tests, there is already a NotificationService object. | 53 // When running in unit tests, there is already a NotificationService object. |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 content::Source<Profile>(profile_)); | 367 content::Source<Profile>(profile_)); |
368 notification_registrar_.Remove( | 368 notification_registrar_.Remove( |
369 this, chrome::NOTIFICATION_HISTORY_URLS_DELETED, | 369 this, chrome::NOTIFICATION_HISTORY_URLS_DELETED, |
370 content::Source<Profile>(profile_)); | 370 content::Source<Profile>(profile_)); |
371 notification_registrar_.Remove( | 371 notification_registrar_.Remove( |
372 this, chrome::NOTIFICATION_HISTORY_URL_VISITED, | 372 this, chrome::NOTIFICATION_HISTORY_URL_VISITED, |
373 content::Source<Profile>(profile_)); | 373 content::Source<Profile>(profile_)); |
374 } | 374 } |
375 | 375 |
376 } // namespace browser_sync | 376 } // namespace browser_sync |
OLD | NEW |