// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Internal, used by fileSystemProvider's custom bindings. These functions are
// called when events' callbacks are invoked.
[implemented_in="chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.h",
 nodoc]
namespace fileSystemProviderInternal {
  interface Functions {
    // Internal. Success callback of the <code>onUnmountRequested</code>
    // event. Must be called when unmounting is completed.
    static void unmountRequestedSuccess(
        DOMString fileSystemId,
        long requestId,
        long executionTime);

    // Internal. Success callback of the <code>onGetMetadataRequested</code>
    // event. Must be called if metadata is available.
    static void getMetadataRequestedSuccess(
        DOMString fileSystemId,
        long requestId,
        fileSystemProvider.EntryMetadata metadata,
        long executionTime);

    // Internal. Success callback of the <code>onGetActionsRequested</code>
    // event. Must be called if actions are available.
    static void getActionsRequestedSuccess(
        DOMString fileSystemId,
        long requestId,
        fileSystemProvider.Action[] actions,
        long executionTime);

    // Internal. Success callback of the <code>onReadDirectoryRequested</code>
    // event. Can be called multiple times per request.
    static void readDirectoryRequestedSuccess(
        DOMString fileSystemId,
        long requestId,
        fileSystemProvider.EntryMetadata[] entries,
        boolean hasMore,
        long executionTime);

    // Internal. Success callback of the <code>onReadFileRequested</code>
    // event. Can be called multiple times per request.
    static void readFileRequestedSuccess(
        DOMString fileSystemId,
        long requestId,
        ArrayBuffer data,
        boolean hasMore,
        long executionTime);

    // Internal. Success callback of all of the operation requests, which do not
    // return any value. Must be called in case of a success.
    static void operationRequestedSuccess(
        DOMString fileSystemId,
        long requestId,
        long executionTime);

    // Internal. Error callback of all of the operation requests. Must be called
    // if an operation fails.
    static void operationRequestedError(
        DOMString fileSystemId,
        long requestId,
        fileSystemProvider.ProviderError error,
        long executionTime);
  };
};

