| 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/notifier/non_blocking_invalidator.h" | 5 #include "sync/notifier/non_blocking_invalidator.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 void CreateInvalidator( | 37 void CreateInvalidator( |
| 38 const std::string& initial_state, | 38 const std::string& initial_state, |
| 39 const base::WeakPtr<InvalidationStateTracker>& | 39 const base::WeakPtr<InvalidationStateTracker>& |
| 40 invalidation_state_tracker) { | 40 invalidation_state_tracker) { |
| 41 DCHECK(!invalidator_.get()); | 41 DCHECK(!invalidator_.get()); |
| 42 base::Thread::Options options; | 42 base::Thread::Options options; |
| 43 options.message_loop_type = MessageLoop::TYPE_IO; | 43 options.message_loop_type = MessageLoop::TYPE_IO; |
| 44 io_thread_.StartWithOptions(options); | 44 io_thread_.StartWithOptions(options); |
| 45 request_context_getter_ = | 45 request_context_getter_ = |
| 46 new net::TestURLRequestContextGetter(io_thread_.message_loop_proxy()); | 46 new TestURLRequestContextGetter(io_thread_.message_loop_proxy()); |
| 47 notifier::NotifierOptions invalidator_options; | 47 notifier::NotifierOptions invalidator_options; |
| 48 invalidator_options.request_context_getter = request_context_getter_; | 48 invalidator_options.request_context_getter = request_context_getter_; |
| 49 invalidator_.reset( | 49 invalidator_.reset( |
| 50 new NonBlockingInvalidator( | 50 new NonBlockingInvalidator( |
| 51 invalidator_options, | 51 invalidator_options, |
| 52 InvalidationStateMap(), | 52 InvalidationStateMap(), |
| 53 initial_state, | 53 initial_state, |
| 54 MakeWeakHandle(invalidation_state_tracker), | 54 MakeWeakHandle(invalidation_state_tracker), |
| 55 "fake_client_info")); | 55 "fake_client_info")); |
| 56 } | 56 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 scoped_ptr<NonBlockingInvalidator> invalidator_; | 97 scoped_ptr<NonBlockingInvalidator> invalidator_; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 INSTANTIATE_TYPED_TEST_CASE_P( | 100 INSTANTIATE_TYPED_TEST_CASE_P( |
| 101 NonBlockingInvalidatorTest, InvalidatorTest, | 101 NonBlockingInvalidatorTest, InvalidatorTest, |
| 102 NonBlockingInvalidatorTestDelegate); | 102 NonBlockingInvalidatorTestDelegate); |
| 103 | 103 |
| 104 } // namespace | 104 } // namespace |
| 105 | 105 |
| 106 } // namespace syncer | 106 } // namespace syncer |
| OLD | NEW |