drive_common_callbacks.h 1.2 KB

1234567891011121314151617181920212223242526272829303132
  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. // This file contains callback types used for communicating with the Drive
  6. // server via WAPI (Documents List API) and Drive API.
  7. #ifndef GOOGLE_APIS_DRIVE_DRIVE_COMMON_CALLBACKS_H_
  8. #define GOOGLE_APIS_DRIVE_DRIVE_COMMON_CALLBACKS_H_
  9. #include "base/callback.h"
  10. #include "google_apis/common/api_error_codes.h"
  11. namespace google_apis {
  12. class AboutResource;
  13. // Callback used for getting AboutResource.
  14. typedef base::OnceCallback<void(ApiErrorCode error,
  15. std::unique_ptr<AboutResource> about_resource)>
  16. AboutResourceCallback;
  17. // Closure for canceling a certain request. Each request-issuing method returns
  18. // this type of closure. If it is called during the request is in-flight, the
  19. // callback passed with the request is invoked with CANCELLED. If the
  20. // request is already finished, nothing happens.
  21. typedef base::OnceClosure CancelCallbackOnce;
  22. typedef base::RepeatingClosure CancelCallbackRepeating;
  23. } // namespace google_apis
  24. #endif // GOOGLE_APIS_DRIVE_DRIVE_COMMON_CALLBACKS_H_