Only allow leveldb to use the minimum amount of file descriptors.
[chromium-blink-merge.git] / chrome / browser / sync_file_system / drive_backend / drive_file_sync_util.h
blobe67c34e0cc16df3fc2ffb90b4c201f875ed2a4af
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.
5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_FILE_SYNC_UTIL_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_FILE_SYNC_UTIL_H_
8 #include "chrome/browser/google_apis/gdata_errorcode.h"
9 #include "webkit/browser/fileapi/syncable/sync_status_code.h"
11 namespace sync_file_system {
13 // Translates GDataErrorCode to SyncStatusCode.
14 SyncStatusCode GDataErrorCodeToSyncStatusCode(
15 google_apis::GDataErrorCode error);
17 // Enables or disables Drive API in Sync FileSystem API.
18 // TODO(nhiroki): This method should go away when we completely migrate to
19 // DriveAPI. (http://crbug.com/234557)
20 void SetDisableDriveAPI(bool flag);
22 // Returns true if we disable Drive API in Sync FileSystem API.
23 // It is enabled by default but can be overridden by a command-line switch
24 // (--disable-drive-api-for-syncfs) or by calling SetDisableDriveAPI().
25 // TODO(nhiroki): This method should go away when we completely migrate to
26 // DriveAPI. (http://crbug.com/234557)
27 bool IsDriveAPIDisabled();
29 class ScopedDisableDriveAPI {
30 public:
31 ScopedDisableDriveAPI();
32 ~ScopedDisableDriveAPI();
34 private:
35 bool was_disabled_;
37 DISALLOW_COPY_AND_ASSIGN(ScopedDisableDriveAPI);
40 } // namespace sync_file_system
42 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_FILE_SYNC_UTIL_H_