Home | History | Annotate | Download | only in drive
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DEBUG_INFO_COLLECTOR_H_
      6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DEBUG_INFO_COLLECTOR_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "base/callback_forward.h"
     10 #include "chrome/browser/chromeos/drive/file_cache.h"
     11 #include "chrome/browser/chromeos/drive/file_system_interface.h"
     12 
     13 namespace drive {
     14 
     15 // This class provides some methods which are useful to show the debug
     16 // info on chrome://drive-internals page.
     17 // All the method should be called on UI thread.
     18 class DebugInfoCollector {
     19  public:
     20   DebugInfoCollector(FileSystemInterface* file_system,
     21                      internal::FileCache* file_cache);
     22   ~DebugInfoCollector();
     23 
     24   // Iterates all files in the file cache and calls |iteration_callback| for
     25   // each file. |completion_callback| is run upon completion.
     26   // |iteration_callback| and |completion_callback| must not be null.
     27   void IterateFileCache(const CacheIterateCallback& iteration_callback,
     28                         const base::Closure& completion_callback);
     29 
     30   // Returns miscellaneous metadata of the file system like the largest
     31   // timestamp. |callback| must not be null.
     32   void GetMetadata(const GetFilesystemMetadataCallback& callback);
     33 
     34  private:
     35   FileSystemInterface* file_system_;  // Not owned.
     36   internal::FileCache* file_cache_;  // Not owned.
     37 
     38   DISALLOW_COPY_AND_ASSIGN(DebugInfoCollector);
     39 };
     40 
     41 }  // namespace drive
     42 
     43 #endif  // CHROME_BROWSER_CHROMEOS_DRIVE_DEBUG_INFO_COLLECTOR_H_
     44