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

Side by Side Diff: remoting/host/plugin/policy_hack/nat_policy_linux.cc

Issue 7888022: Add DISABLE_TCP_TRANSPORT flag in the Transport API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 3 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 | Annotate | Revision Log
OLDNEW
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 // Most of this code is copied from various classes in 5 // Most of this code is copied from various classes in
6 // src/chrome/browser/policy. In particular, look at 6 // src/chrome/browser/policy. In particular, look at
7 // 7 //
8 // file_based_policy_loader.{h,cc} 8 // file_based_policy_loader.{h,cc}
9 // config_dir_policy_provider.{h,cc} 9 // config_dir_policy_provider.{h,cc}
10 // 10 //
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 DCHECK(OnPolicyThread()); 64 DCHECK(OnPolicyThread());
65 watcher_.reset(new base::files::FilePathWatcher()); 65 watcher_.reset(new base::files::FilePathWatcher());
66 66
67 if (!config_dir_.empty() && 67 if (!config_dir_.empty() &&
68 !watcher_->Watch( 68 !watcher_->Watch(
69 config_dir_, 69 config_dir_,
70 new FilePathWatcherDelegate(weak_factory_.GetWeakPtr()))) { 70 new FilePathWatcherDelegate(weak_factory_.GetWeakPtr()))) {
71 OnFilePathError(config_dir_); 71 OnFilePathError(config_dir_);
72 } 72 }
73 73
74 LOG(ERROR) << "Start Watching";
75
74 // There might have been changes to the directory in the time between 76 // There might have been changes to the directory in the time between
75 // construction of the loader and initialization of the watcher. Call reload 77 // construction of the loader and initialization of the watcher. Call reload
76 // to detect if that is the case. 78 // to detect if that is the case.
77 Reload(); 79 Reload();
78 80
79 ScheduleFallbackReloadTask(); 81 ScheduleFallbackReloadTask();
80 } 82 }
81 83
82 virtual void StopWatchingInternal() OVERRIDE { 84 virtual void StopWatchingInternal() OVERRIDE {
85 LOG(ERROR) << "Stop Watching";
83 DCHECK(OnPolicyThread()); 86 DCHECK(OnPolicyThread());
84 // Cancel any inflight requests. 87 // Cancel any inflight requests.
85 watcher_.reset(); 88 watcher_.reset();
86 } 89 }
87 90
88 // Called by FilePathWatcherDelegate. 91 // Called by FilePathWatcherDelegate.
89 virtual void OnFilePathError(const FilePath& path) { 92 virtual void OnFilePathError(const FilePath& path) {
90 LOG(ERROR) << "NatPolicyLinux on " << path.value() 93 LOG(ERROR) << "NatPolicyLinux on " << path.value()
91 << " failed."; 94 << " failed.";
92 } 95 }
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 base::WeakPtrFactory<NatPolicyLinux> weak_factory_; 264 base::WeakPtrFactory<NatPolicyLinux> weak_factory_;
262 }; 265 };
263 266
264 NatPolicy* NatPolicy::Create(base::MessageLoopProxy* message_loop_proxy) { 267 NatPolicy* NatPolicy::Create(base::MessageLoopProxy* message_loop_proxy) {
265 FilePath policy_dir(kPolicyDir); 268 FilePath policy_dir(kPolicyDir);
266 return new NatPolicyLinux(message_loop_proxy, policy_dir); 269 return new NatPolicyLinux(message_loop_proxy, policy_dir);
267 } 270 }
268 271
269 } // namespace policy_hack 272 } // namespace policy_hack
270 } // namespace remoting 273 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698