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 "sync/engine/sync_scheduler_impl.h" | 5 #include "sync/engine/sync_scheduler_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstring> | 8 #include <cstring> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/location.h" | 14 #include "base/location.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/message_loop/message_loop.h" | |
17 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
| 17 #include "base/threading/platform_thread.h" |
18 #include "base/threading/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
19 #include "sync/engine/backoff_delay_provider.h" | 19 #include "sync/engine/backoff_delay_provider.h" |
20 #include "sync/engine/syncer.h" | 20 #include "sync/engine/syncer.h" |
21 #include "sync/protocol/proto_enum_conversions.h" | 21 #include "sync/protocol/proto_enum_conversions.h" |
22 #include "sync/protocol/sync.pb.h" | 22 #include "sync/protocol/sync.pb.h" |
23 #include "sync/util/data_type_histogram.h" | 23 #include "sync/util/data_type_histogram.h" |
24 #include "sync/util/logging.h" | 24 #include "sync/util/logging.h" |
25 | 25 |
26 using base::TimeDelta; | 26 using base::TimeDelta; |
27 using base::TimeTicks; | 27 using base::TimeTicks; |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // | 221 // |
222 // In all cases except (2), we want to retry contacting the server. We | 222 // In all cases except (2), we want to retry contacting the server. We |
223 // call TryCanaryJob to achieve this, and note that nothing -- not even a | 223 // call TryCanaryJob to achieve this, and note that nothing -- not even a |
224 // canary job -- can bypass a THROTTLED WaitInterval. The only thing that | 224 // canary job -- can bypass a THROTTLED WaitInterval. The only thing that |
225 // has the authority to do that is the Unthrottle timer. | 225 // has the authority to do that is the Unthrottle timer. |
226 TryCanaryJob(); | 226 TryCanaryJob(); |
227 } | 227 } |
228 | 228 |
229 void SyncSchedulerImpl::Start(Mode mode, base::Time last_poll_time) { | 229 void SyncSchedulerImpl::Start(Mode mode, base::Time last_poll_time) { |
230 DCHECK(CalledOnValidThread()); | 230 DCHECK(CalledOnValidThread()); |
231 std::string thread_name = base::MessageLoop::current()->thread_name(); | 231 std::string thread_name = base::PlatformThread::GetName(); |
232 if (thread_name.empty()) | 232 if (thread_name.empty()) |
233 thread_name = "<Main thread>"; | 233 thread_name = "<Main thread>"; |
234 SDVLOG(2) << "Start called from thread " | 234 SDVLOG(2) << "Start called from thread " |
235 << thread_name << " with mode " << GetModeString(mode); | 235 << thread_name << " with mode " << GetModeString(mode); |
236 if (!started_) { | 236 if (!started_) { |
237 started_ = true; | 237 started_ = true; |
238 SendInitialSnapshot(); | 238 SendInitialSnapshot(); |
239 } | 239 } |
240 | 240 |
241 DCHECK(syncer_.get()); | 241 DCHECK(syncer_.get()); |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 | 990 |
991 #undef SDVLOG_LOC | 991 #undef SDVLOG_LOC |
992 | 992 |
993 #undef SDVLOG | 993 #undef SDVLOG |
994 | 994 |
995 #undef SLOG | 995 #undef SLOG |
996 | 996 |
997 #undef ENUM_CASE | 997 #undef ENUM_CASE |
998 | 998 |
999 } // namespace syncer | 999 } // namespace syncer |
OLD | NEW |