OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/history/history_backend.h" | 10 #include "chrome/browser/history/history_backend.h" |
11 #include "chrome/browser/history/history_notifications.h" | 11 #include "chrome/browser/history/history_notifications.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/sync/glue/typed_url_model_associator.h" | 13 #include "chrome/browser/sync/glue/typed_url_model_associator.h" |
14 #include "chrome/browser/sync/internal_api/change_record.h" | 14 #include "chrome/browser/sync/internal_api/change_record.h" |
15 #include "chrome/browser/sync/internal_api/read_node.h" | 15 #include "chrome/browser/sync/internal_api/read_node.h" |
16 #include "chrome/browser/sync/internal_api/write_node.h" | 16 #include "chrome/browser/sync/internal_api/write_node.h" |
17 #include "chrome/browser/sync/internal_api/write_transaction.h" | 17 #include "chrome/browser/sync/internal_api/write_transaction.h" |
18 #include "chrome/browser/sync/profile_sync_service.h" | 18 #include "chrome/browser/sync/profile_sync_service.h" |
19 #include "chrome/browser/sync/protocol/typed_url_specifics.pb.h" | 19 #include "chrome/browser/sync/protocol/typed_url_specifics.pb.h" |
20 #include "chrome/common/chrome_notification_types.h" | 20 #include "chrome/common/chrome_notification_types.h" |
21 #include "content/browser/notification_service_impl.h" | 21 #include "content/browser/notification_service_impl.h" |
22 | 22 |
| 23 using content::BrowserThread; |
| 24 |
23 namespace browser_sync { | 25 namespace browser_sync { |
24 | 26 |
25 // This is the threshold at which we start throttling sync updates for typed | 27 // This is the threshold at which we start throttling sync updates for typed |
26 // URLs - any URLs with a typed_count >= this threshold will be throttled. | 28 // URLs - any URLs with a typed_count >= this threshold will be throttled. |
27 static const int kTypedUrlVisitThrottleThreshold = 10; | 29 static const int kTypedUrlVisitThrottleThreshold = 10; |
28 | 30 |
29 // This is the multiple we use when throttling sync updates. If the multiple is | 31 // This is the multiple we use when throttling sync updates. If the multiple is |
30 // N, we sync up every Nth update (i.e. when typed_count % N == 0). | 32 // N, we sync up every Nth update (i.e. when typed_count % N == 0). |
31 static const int kTypedUrlVisitThrottleMultiple = 10; | 33 static const int kTypedUrlVisitThrottleMultiple = 10; |
32 | 34 |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 content::Source<Profile>(profile_)); | 367 content::Source<Profile>(profile_)); |
366 notification_registrar_.Remove( | 368 notification_registrar_.Remove( |
367 this, chrome::NOTIFICATION_HISTORY_URLS_DELETED, | 369 this, chrome::NOTIFICATION_HISTORY_URLS_DELETED, |
368 content::Source<Profile>(profile_)); | 370 content::Source<Profile>(profile_)); |
369 notification_registrar_.Remove( | 371 notification_registrar_.Remove( |
370 this, chrome::NOTIFICATION_HISTORY_URL_VISITED, | 372 this, chrome::NOTIFICATION_HISTORY_URL_VISITED, |
371 content::Source<Profile>(profile_)); | 373 content::Source<Profile>(profile_)); |
372 } | 374 } |
373 | 375 |
374 } // namespace browser_sync | 376 } // namespace browser_sync |
OLD | NEW |