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

Side by Side Diff: components/drive/file_write_watcher.cc

Issue 1546143002: Switch to standard integer types in components/, part 1 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 | « components/drive/file_write_watcher.h ('k') | components/drive/file_write_watcher_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/drive/file_write_watcher.h" 5 #include "components/drive/file_write_watcher.h"
6 6
7 #include <stddef.h>
8 #include <stdint.h>
9
7 #include <map> 10 #include <map>
8 #include <vector> 11 #include <vector>
9 12
10 #include "base/bind.h" 13 #include "base/bind.h"
11 #include "base/callback.h" 14 #include "base/callback.h"
12 #include "base/files/file_path_watcher.h" 15 #include "base/files/file_path_watcher.h"
16 #include "base/macros.h"
13 #include "base/stl_util.h" 17 #include "base/stl_util.h"
14 #include "base/timer/timer.h" 18 #include "base/timer/timer.h"
15 #include "google_apis/drive/task_util.h" 19 #include "google_apis/drive/task_util.h"
16 20
17 namespace drive { 21 namespace drive {
18 namespace internal { 22 namespace internal {
19 23
20 namespace { 24 namespace {
21 const int64 kWriteEventDelayInSeconds = 5; 25 const int64_t kWriteEventDelayInSeconds = 5;
22 } // namespace 26 } // namespace
23 27
24 // base::FileWatcher needs to live in a thread that is allowed to do File IO 28 // base::FileWatcher needs to live in a thread that is allowed to do File IO
25 // and has a TYPE_IO message loop: that is, FILE thread. This class bridges the 29 // and has a TYPE_IO message loop: that is, FILE thread. This class bridges the
26 // UI thread and FILE thread, and does all the main tasks in the FILE thread. 30 // UI thread and FILE thread, and does all the main tasks in the FILE thread.
27 class FileWriteWatcher::FileWriteWatcherImpl { 31 class FileWriteWatcher::FileWriteWatcherImpl {
28 public: 32 public:
29 explicit FileWriteWatcherImpl(base::SingleThreadTaskRunner* file_task_runner); 33 explicit FileWriteWatcherImpl(base::SingleThreadTaskRunner* file_task_runner);
30 34
31 // Forwards the call to DestoryOnFileThread(). This method must be used to 35 // Forwards the call to DestoryOnFileThread(). This method must be used to
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 DCHECK(thread_checker_.CalledOnValidThread()); 202 DCHECK(thread_checker_.CalledOnValidThread());
199 watcher_impl_->StartWatch(file_path, on_start_callback, on_write_callback); 203 watcher_impl_->StartWatch(file_path, on_start_callback, on_write_callback);
200 } 204 }
201 205
202 void FileWriteWatcher::DisableDelayForTesting() { 206 void FileWriteWatcher::DisableDelayForTesting() {
203 watcher_impl_->set_delay(base::TimeDelta()); 207 watcher_impl_->set_delay(base::TimeDelta());
204 } 208 }
205 209
206 } // namespace internal 210 } // namespace internal
207 } // namespace drive 211 } // namespace drive
OLDNEW
« no previous file with comments | « components/drive/file_write_watcher.h ('k') | components/drive/file_write_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698