| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "chrome/browser/devtools/devtools_file_watcher.h" | 5 #include "chrome/browser/devtools/devtools_file_watcher.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/files/file_enumerator.h" | 12 #include "base/files/file_enumerator.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/files/file_path_watcher.h" | 14 #include "base/files/file_path_watcher.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_ptr.h" |
| 16 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
| 17 | 18 |
| 18 using content::BrowserThread; | 19 using content::BrowserThread; |
| 19 | 20 |
| 20 static int kFirstThrottleTimeout = 10; | 21 static int kFirstThrottleTimeout = 10; |
| 21 static int kDefaultThrottleTimeout = 200; | 22 static int kDefaultThrottleTimeout = 200; |
| 22 | 23 |
| 23 // DevToolsFileWatcher::SharedFileWatcher -------------------------------------- | 24 // DevToolsFileWatcher::SharedFileWatcher -------------------------------------- |
| 24 | 25 |
| 25 class DevToolsFileWatcher::SharedFileWatcher : | 26 class DevToolsFileWatcher::SharedFileWatcher : |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 173 |
| 173 void DevToolsFileWatcher::AddWatch(const base::FilePath& path) { | 174 void DevToolsFileWatcher::AddWatch(const base::FilePath& path) { |
| 174 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 175 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
| 175 shared_watcher_->AddWatch(path); | 176 shared_watcher_->AddWatch(path); |
| 176 } | 177 } |
| 177 | 178 |
| 178 void DevToolsFileWatcher::RemoveWatch(const base::FilePath& path) { | 179 void DevToolsFileWatcher::RemoveWatch(const base::FilePath& path) { |
| 179 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 180 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
| 180 shared_watcher_->RemoveWatch(path); | 181 shared_watcher_->RemoveWatch(path); |
| 181 } | 182 } |
| OLD | NEW |