Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: net/proxy/proxy_config_service_android.cc

Issue 2423713002: Remove usage of FOR_EACH_OBSERVER macro in net (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/proxy/polling_proxy_config_service.cc ('k') | net/proxy/proxy_config_service_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "net/proxy/proxy_config_service_android.h" 5 #include "net/proxy/proxy_config_service_android.h"
6 6
7 #include <sys/system_properties.h> 7 #include <sys/system_properties.h>
8 8
9 #include "base/android/context_utils.h" 9 #include "base/android/context_utils.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 if (java_proxy_change_listener_.is_null()) 329 if (java_proxy_change_listener_.is_null())
330 return; 330 return;
331 JNIEnv* env = AttachCurrentThread(); 331 JNIEnv* env = AttachCurrentThread();
332 Java_ProxyChangeListener_stop(env, java_proxy_change_listener_); 332 Java_ProxyChangeListener_stop(env, java_proxy_change_listener_);
333 } 333 }
334 334
335 // Called on the network thread. 335 // Called on the network thread.
336 void SetNewConfigOnNetworkThread(const ProxyConfig& proxy_config) { 336 void SetNewConfigOnNetworkThread(const ProxyConfig& proxy_config) {
337 DCHECK(OnNetworkThread()); 337 DCHECK(OnNetworkThread());
338 proxy_config_ = proxy_config; 338 proxy_config_ = proxy_config;
339 FOR_EACH_OBSERVER(Observer, observers_, 339 for (auto& observer : observers_) {
340 OnProxyConfigChanged(proxy_config, 340 observer.OnProxyConfigChanged(proxy_config,
341 ProxyConfigService::CONFIG_VALID)); 341 ProxyConfigService::CONFIG_VALID);
342 }
342 } 343 }
343 344
344 bool OnJNIThread() const { 345 bool OnJNIThread() const {
345 return jni_task_runner_->RunsTasksOnCurrentThread(); 346 return jni_task_runner_->RunsTasksOnCurrentThread();
346 } 347 }
347 348
348 bool OnNetworkThread() const { 349 bool OnNetworkThread() const {
349 return network_task_runner_->RunsTasksOnCurrentThread(); 350 return network_task_runner_->RunsTasksOnCurrentThread();
350 } 351 }
351 352
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 network_task_runner, jni_task_runner, get_property_callback)) { 406 network_task_runner, jni_task_runner, get_property_callback)) {
406 delegate_->SetupJNI(); 407 delegate_->SetupJNI();
407 delegate_->FetchInitialConfig(); 408 delegate_->FetchInitialConfig();
408 } 409 }
409 410
410 void ProxyConfigServiceAndroid::ProxySettingsChanged() { 411 void ProxyConfigServiceAndroid::ProxySettingsChanged() {
411 delegate_->ProxySettingsChanged(); 412 delegate_->ProxySettingsChanged();
412 } 413 }
413 414
414 } // namespace net 415 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/polling_proxy_config_service.cc ('k') | net/proxy/proxy_config_service_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698