| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "net/base/network_config_watcher_mac.h" | 5 #include "net/base/network_config_watcher_mac.h" |
| 6 | 6 |
| 7 #include <SystemConfiguration/SCDynamicStoreKey.h> | 7 #include <SystemConfiguration/SCDynamicStoreKey.h> |
| 8 #include <SystemConfiguration/SCSchemaDefinitions.h> | 8 #include <SystemConfiguration/SCSchemaDefinitions.h> |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
| 13 #include "base/threading/thread_restrictions.h" |
| 13 #include "base/mac/scoped_cftyperef.h" | 14 #include "base/mac/scoped_cftyperef.h" |
| 14 #include "base/threading/thread_restrictions.h" | |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 // Called back by OS. Calls OnNetworkConfigChange(). | 20 // Called back by OS. Calls OnNetworkConfigChange(). |
| 21 void DynamicStoreCallback(SCDynamicStoreRef /* store */, | 21 void DynamicStoreCallback(SCDynamicStoreRef /* store */, |
| 22 CFArrayRef changed_keys, | 22 CFArrayRef changed_keys, |
| 23 void* config_delegate) { | 23 void* config_delegate) { |
| 24 NetworkConfigWatcherMac::Delegate* net_config_delegate = | 24 NetworkConfigWatcherMac::Delegate* net_config_delegate = |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // We create this notifier thread because the notification implementation | 113 // We create this notifier thread because the notification implementation |
| 114 // needs a thread with a CFRunLoop, and there's no guarantee that | 114 // needs a thread with a CFRunLoop, and there's no guarantee that |
| 115 // MessageLoop::current() meets that criterion. | 115 // MessageLoop::current() meets that criterion. |
| 116 base::Thread::Options thread_options(MessageLoop::TYPE_UI, 0); | 116 base::Thread::Options thread_options(MessageLoop::TYPE_UI, 0); |
| 117 notifier_thread_->StartWithOptions(thread_options); | 117 notifier_thread_->StartWithOptions(thread_options); |
| 118 } | 118 } |
| 119 | 119 |
| 120 NetworkConfigWatcherMac::~NetworkConfigWatcherMac() {} | 120 NetworkConfigWatcherMac::~NetworkConfigWatcherMac() {} |
| 121 | 121 |
| 122 } // namespace net | 122 } // namespace net |
| OLD | NEW |