Commit c6a932cc authored by Anand K. Mistry's avatar Anand K. Mistry Committed by Commit Bot

Log file manager APIs that take too long.

Only "very long" API calls are logged to the user's log. Regular "long"
APIs are logged to the drive-internals log.

BUG=904658

Change-Id: Ic959174f9927e7fe398706b8270a60c35df82e70
Reviewed-on: https://chromium-review.googlesource.com/c/1488393
Commit-Queue: Anand Mistry <amistry@chromium.org>
Reviewed-by: default avatarSam McNally <sammc@chromium.org>
Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635841}
parent a1f3134a
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <vector> #include <vector>
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h"
#include "extensions/browser/extension_function.h" #include "extensions/browser/extension_function.h"
class Browser; class Browser;
...@@ -80,7 +81,7 @@ class FileSelectorFactory { ...@@ -80,7 +81,7 @@ class FileSelectorFactory {
// The fileBrowserHandlerInternal.selectFile extension function implementation. // The fileBrowserHandlerInternal.selectFile extension function implementation.
// See the file description for more info. // See the file description for more info.
class FileBrowserHandlerInternalSelectFileFunction class FileBrowserHandlerInternalSelectFileFunction
: public UIThreadExtensionFunction { : public extensions::LoggedUIThreadExtensionFunction {
public: public:
// Default constructor used in production code. // Default constructor used in production code.
// It will create its own FileSelectorFactory implementation, and set the // It will create its own FileSelectorFactory implementation, and set the
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
#include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h" #include "chrome/browser/chromeos/extensions/file_manager/private_api_base.h"
#include <inttypes.h>
#include <stdint.h> #include <stdint.h>
#include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h"
#include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h"
#include "chrome/browser/extensions/chrome_extension_function_details.h" #include "chrome/browser/extensions/chrome_extension_function_details.h"
#include "components/drive/event_logger.h" #include "components/drive/event_logger.h"
...@@ -14,36 +15,60 @@ ...@@ -14,36 +15,60 @@
namespace extensions { namespace extensions {
namespace { namespace {
const int kSlowOperationThresholdMs = 500; // In ms. constexpr base::TimeDelta kDefaultSlowOperationThreshold =
base::TimeDelta::FromMilliseconds(500);
constexpr base::TimeDelta kDefaultVerySlowOperationThreshold =
base::TimeDelta::FromSeconds(5);
} // namespace } // namespace
LoggedUIThreadExtensionFunction::LoggedUIThreadExtensionFunction() LoggedUIThreadExtensionFunction::LoggedUIThreadExtensionFunction()
: log_on_completion_(false) { : log_on_completion_(false),
start_time_ = base::Time::Now(); slow_threshold_(kDefaultSlowOperationThreshold),
very_slow_threshold_(kDefaultVerySlowOperationThreshold) {
start_time_ = base::TimeTicks::Now();
} }
LoggedUIThreadExtensionFunction::~LoggedUIThreadExtensionFunction() = default; LoggedUIThreadExtensionFunction::~LoggedUIThreadExtensionFunction() = default;
void LoggedUIThreadExtensionFunction::OnResponded() { void LoggedUIThreadExtensionFunction::OnResponded() {
base::TimeDelta elapsed = base::TimeTicks::Now() - start_time_;
const ChromeExtensionFunctionDetails chrome_details(this); const ChromeExtensionFunctionDetails chrome_details(this);
drive::EventLogger* logger = drive::EventLogger* logger =
file_manager::util::GetLogger(chrome_details.GetProfile()); file_manager::util::GetLogger(chrome_details.GetProfile());
if (logger) { if (logger && log_on_completion_) {
int64_t elapsed = (base::Time::Now() - start_time_).InMilliseconds();
DCHECK(response_type()); DCHECK(response_type());
bool success = *response_type() == SUCCEEDED; bool success = *response_type() == SUCCEEDED;
if (log_on_completion_) { logger->Log(logging::LOG_INFO, "%s[%d] %s. (elapsed time: %" PRId64 "ms)",
logger->Log(logging::LOG_INFO, "%s[%d] %s. (elapsed time: %sms)", name(), name(), request_id(), success ? "succeeded" : "failed",
request_id(), success ? "succeeded" : "failed", elapsed.InMilliseconds());
base::NumberToString(elapsed).c_str()); }
} else if (elapsed >= kSlowOperationThresholdMs) {
logger->Log(logging::LOG_WARNING, // Log performance issues separately from completion.
"PEFORMANCE WARNING: %s[%d] was slow. (elapsed time: %sms)", if (elapsed >= very_slow_threshold_) {
name(), request_id(), base::NumberToString(elapsed).c_str()); auto log_message = base::StringPrintf(
"%s[%d] was VERY slow. (elapsed time: %" PRId64 "ms)", name(),
request_id(), elapsed.InMilliseconds());
LOG(WARNING) << log_message;
if (logger) {
logger->LogRawString(logging::LOG_ERROR,
"PEFORMANCE WARNING: " + log_message);
} }
} else if (logger && elapsed >= slow_threshold_) {
logger->Log(logging::LOG_WARNING,
"PEFORMANCE WARNING: %s[%d] was slow. (elapsed time: %" PRId64
"ms)",
name(), request_id(), elapsed.InMilliseconds());
} }
UIThreadExtensionFunction::OnResponded(); UIThreadExtensionFunction::OnResponded();
} }
void LoggedUIThreadExtensionFunction::SetWarningThresholds(
base::TimeDelta slow_threshold,
base::TimeDelta very_slow_threshold) {
slow_threshold_ = slow_threshold;
very_slow_threshold_ = very_slow_threshold;
}
} // namespace extensions } // namespace extensions
...@@ -30,14 +30,20 @@ class LoggedUIThreadExtensionFunction : public UIThreadExtensionFunction { ...@@ -30,14 +30,20 @@ class LoggedUIThreadExtensionFunction : public UIThreadExtensionFunction {
// UIThreadExtensionFunction overrides. // UIThreadExtensionFunction overrides.
void OnResponded() override; void OnResponded() override;
void SetWarningThresholds(base::TimeDelta slow_threshold,
base::TimeDelta very_slow_threshold);
// Sets the logging on completion flag. By default, logging is turned off. // Sets the logging on completion flag. By default, logging is turned off.
void set_log_on_completion(bool log_on_completion) { void set_log_on_completion(bool log_on_completion) {
log_on_completion_ = log_on_completion; log_on_completion_ = log_on_completion;
} }
private: private:
base::Time start_time_; base::TimeTicks start_time_;
bool log_on_completion_; bool log_on_completion_;
base::TimeDelta slow_threshold_;
base::TimeDelta very_slow_threshold_;
}; };
} // namespace extensions } // namespace extensions
......
...@@ -90,6 +90,12 @@ const char kDriveConnectionReasonNoService[] = "no_service"; ...@@ -90,6 +90,12 @@ const char kDriveConnectionReasonNoService[] = "no_service";
// thumbnail. Given that we support hdpi devices, maximum dimension is 360. // thumbnail. Given that we support hdpi devices, maximum dimension is 360.
const int kFileManagerMaximumThumbnailDimension = 360; const int kFileManagerMaximumThumbnailDimension = 360;
// Thresholds for logging slow operations.
constexpr base::TimeDelta kDriveSlowOperationThreshold =
base::TimeDelta::FromSeconds(5);
constexpr base::TimeDelta kDriveVerySlowOperationThreshold =
base::TimeDelta::FromMinutes(1);
std::unique_ptr<std::string> GetShareUrlFromAlternateUrl( std::unique_ptr<std::string> GetShareUrlFromAlternateUrl(
const GURL& alternate_url) { const GURL& alternate_url) {
// Set |share_url| to a modified version of |alternate_url| that opens the // Set |share_url| to a modified version of |alternate_url| that opens the
...@@ -869,6 +875,8 @@ std::unique_ptr<base::ListValue> MakeBlankReturnValue() { ...@@ -869,6 +875,8 @@ std::unique_ptr<base::ListValue> MakeBlankReturnValue() {
FileManagerPrivateInternalGetEntryPropertiesFunction:: FileManagerPrivateInternalGetEntryPropertiesFunction::
FileManagerPrivateInternalGetEntryPropertiesFunction() FileManagerPrivateInternalGetEntryPropertiesFunction()
: processed_count_(0) { : processed_count_(0) {
SetWarningThresholds(kDriveSlowOperationThreshold,
kDriveVerySlowOperationThreshold);
} }
FileManagerPrivateInternalGetEntryPropertiesFunction:: FileManagerPrivateInternalGetEntryPropertiesFunction::
...@@ -955,6 +963,12 @@ void FileManagerPrivateInternalGetEntryPropertiesFunction:: ...@@ -955,6 +963,12 @@ void FileManagerPrivateInternalGetEntryPropertiesFunction::
GetEntryProperties::Results::Create(properties_list_))); GetEntryProperties::Results::Create(properties_list_)));
} }
FileManagerPrivateInternalPinDriveFileFunction::
FileManagerPrivateInternalPinDriveFileFunction() {
SetWarningThresholds(kDriveSlowOperationThreshold,
kDriveVerySlowOperationThreshold);
}
ExtensionFunction::ResponseAction ExtensionFunction::ResponseAction
FileManagerPrivateInternalPinDriveFileFunction::Run() { FileManagerPrivateInternalPinDriveFileFunction::Run() {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
...@@ -1050,6 +1064,12 @@ void FileManagerPrivateInternalPinDriveFileFunction::OnPinStateSet( ...@@ -1050,6 +1064,12 @@ void FileManagerPrivateInternalPinDriveFileFunction::OnPinStateSet(
} }
} }
FileManagerPrivateInternalEnsureFileDownloadedFunction::
FileManagerPrivateInternalEnsureFileDownloadedFunction() {
SetWarningThresholds(kDriveSlowOperationThreshold,
kDriveVerySlowOperationThreshold);
}
ExtensionFunction::ResponseAction ExtensionFunction::ResponseAction
FileManagerPrivateInternalEnsureFileDownloadedFunction::Run() { FileManagerPrivateInternalEnsureFileDownloadedFunction::Run() {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
...@@ -1141,6 +1161,11 @@ FileManagerPrivateInternalCancelFileTransfersFunction::Run() { ...@@ -1141,6 +1161,11 @@ FileManagerPrivateInternalCancelFileTransfersFunction::Run() {
return RespondNow(NoArguments()); return RespondNow(NoArguments());
} }
FileManagerPrivateSearchDriveFunction::FileManagerPrivateSearchDriveFunction() {
SetWarningThresholds(kDriveSlowOperationThreshold,
kDriveVerySlowOperationThreshold);
}
ExtensionFunction::ResponseAction FileManagerPrivateSearchDriveFunction::Run() { ExtensionFunction::ResponseAction FileManagerPrivateSearchDriveFunction::Run() {
using extensions::api::file_manager_private::SearchDrive::Params; using extensions::api::file_manager_private::SearchDrive::Params;
const std::unique_ptr<Params> params(Params::Create(*args_)); const std::unique_ptr<Params> params(Params::Create(*args_));
...@@ -1245,6 +1270,12 @@ void FileManagerPrivateSearchDriveFunction::OnEntryDefinitionList( ...@@ -1245,6 +1270,12 @@ void FileManagerPrivateSearchDriveFunction::OnEntryDefinitionList(
operation_start_); operation_start_);
} }
FileManagerPrivateSearchDriveMetadataFunction::
FileManagerPrivateSearchDriveMetadataFunction() {
SetWarningThresholds(kDriveSlowOperationThreshold,
kDriveVerySlowOperationThreshold);
}
ExtensionFunction::ResponseAction ExtensionFunction::ResponseAction
FileManagerPrivateSearchDriveMetadataFunction::Run() { FileManagerPrivateSearchDriveMetadataFunction::Run() {
using api::file_manager_private::SearchDriveMetadata::Params; using api::file_manager_private::SearchDriveMetadata::Params;
...@@ -1486,6 +1517,12 @@ FileManagerPrivateGetDriveConnectionStateFunction::Run() { ...@@ -1486,6 +1517,12 @@ FileManagerPrivateGetDriveConnectionStateFunction::Run() {
result))); result)));
} }
FileManagerPrivateRequestAccessTokenFunction::
FileManagerPrivateRequestAccessTokenFunction() {
SetWarningThresholds(kDriveSlowOperationThreshold,
kDriveVerySlowOperationThreshold);
}
ExtensionFunction::ResponseAction ExtensionFunction::ResponseAction
FileManagerPrivateRequestAccessTokenFunction::Run() { FileManagerPrivateRequestAccessTokenFunction::Run() {
using extensions::api::file_manager_private::RequestAccessToken::Params; using extensions::api::file_manager_private::RequestAccessToken::Params;
...@@ -1520,6 +1557,12 @@ void FileManagerPrivateRequestAccessTokenFunction::OnAccessTokenFetched( ...@@ -1520,6 +1557,12 @@ void FileManagerPrivateRequestAccessTokenFunction::OnAccessTokenFetched(
Respond(OneArgument(std::make_unique<base::Value>(access_token))); Respond(OneArgument(std::make_unique<base::Value>(access_token)));
} }
FileManagerPrivateInternalRequestDriveShareFunction::
FileManagerPrivateInternalRequestDriveShareFunction() {
SetWarningThresholds(kDriveSlowOperationThreshold,
kDriveVerySlowOperationThreshold);
}
ExtensionFunction::ResponseAction ExtensionFunction::ResponseAction
FileManagerPrivateInternalRequestDriveShareFunction::Run() { FileManagerPrivateInternalRequestDriveShareFunction::Run() {
using extensions::api::file_manager_private_internal::RequestDriveShare:: using extensions::api::file_manager_private_internal::RequestDriveShare::
...@@ -1584,7 +1627,10 @@ void FileManagerPrivateInternalRequestDriveShareFunction::OnAddPermission( ...@@ -1584,7 +1627,10 @@ void FileManagerPrivateInternalRequestDriveShareFunction::OnAddPermission(
} }
FileManagerPrivateInternalGetDownloadUrlFunction:: FileManagerPrivateInternalGetDownloadUrlFunction::
FileManagerPrivateInternalGetDownloadUrlFunction() = default; FileManagerPrivateInternalGetDownloadUrlFunction() {
SetWarningThresholds(kDriveSlowOperationThreshold,
kDriveVerySlowOperationThreshold);
}
FileManagerPrivateInternalGetDownloadUrlFunction:: FileManagerPrivateInternalGetDownloadUrlFunction::
~FileManagerPrivateInternalGetDownloadUrlFunction() = default; ~FileManagerPrivateInternalGetDownloadUrlFunction() = default;
...@@ -1736,7 +1782,10 @@ void FileManagerPrivateInternalGetDownloadUrlFunction::OnGotMetadata( ...@@ -1736,7 +1782,10 @@ void FileManagerPrivateInternalGetDownloadUrlFunction::OnGotMetadata(
} }
FileManagerPrivateInternalGetThumbnailFunction:: FileManagerPrivateInternalGetThumbnailFunction::
FileManagerPrivateInternalGetThumbnailFunction() = default; FileManagerPrivateInternalGetThumbnailFunction() {
SetWarningThresholds(kDriveSlowOperationThreshold,
kDriveVerySlowOperationThreshold);
}
FileManagerPrivateInternalGetThumbnailFunction:: FileManagerPrivateInternalGetThumbnailFunction::
~FileManagerPrivateInternalGetThumbnailFunction() = default; ~FileManagerPrivateInternalGetThumbnailFunction() = default;
......
...@@ -41,6 +41,8 @@ struct EntryProperties; ...@@ -41,6 +41,8 @@ struct EntryProperties;
class FileManagerPrivateInternalEnsureFileDownloadedFunction class FileManagerPrivateInternalEnsureFileDownloadedFunction
: public LoggedUIThreadExtensionFunction { : public LoggedUIThreadExtensionFunction {
public: public:
FileManagerPrivateInternalEnsureFileDownloadedFunction();
DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.ensureFileDownloaded", DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.ensureFileDownloaded",
FILEMANAGERPRIVATE_ENSUREFILEDOWNLOADED) FILEMANAGERPRIVATE_ENSUREFILEDOWNLOADED)
...@@ -89,6 +91,8 @@ class FileManagerPrivateInternalGetEntryPropertiesFunction ...@@ -89,6 +91,8 @@ class FileManagerPrivateInternalGetEntryPropertiesFunction
class FileManagerPrivateInternalPinDriveFileFunction class FileManagerPrivateInternalPinDriveFileFunction
: public LoggedUIThreadExtensionFunction { : public LoggedUIThreadExtensionFunction {
public: public:
FileManagerPrivateInternalPinDriveFileFunction();
DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.pinDriveFile", DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.pinDriveFile",
FILEMANAGERPRIVATEINTERNAL_PINDRIVEFILE) FILEMANAGERPRIVATEINTERNAL_PINDRIVEFILE)
...@@ -110,7 +114,7 @@ class FileManagerPrivateInternalPinDriveFileFunction ...@@ -110,7 +114,7 @@ class FileManagerPrivateInternalPinDriveFileFunction
// Implements the chrome.fileManagerPrivate.cancelFileTransfers method. // Implements the chrome.fileManagerPrivate.cancelFileTransfers method.
class FileManagerPrivateInternalCancelFileTransfersFunction class FileManagerPrivateInternalCancelFileTransfersFunction
: public LoggedUIThreadExtensionFunction { : public UIThreadExtensionFunction {
public: public:
DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.cancelFileTransfers", DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.cancelFileTransfers",
FILEMANAGERPRIVATEINTERNAL_CANCELFILETRANSFERS) FILEMANAGERPRIVATEINTERNAL_CANCELFILETRANSFERS)
...@@ -127,6 +131,8 @@ class FileManagerPrivateSearchDriveFunction ...@@ -127,6 +131,8 @@ class FileManagerPrivateSearchDriveFunction
public: public:
typedef std::vector<drive::SearchResultInfo> SearchResultInfoList; typedef std::vector<drive::SearchResultInfo> SearchResultInfoList;
FileManagerPrivateSearchDriveFunction();
DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.searchDrive", DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.searchDrive",
FILEMANAGERPRIVATE_SEARCHDRIVE) FILEMANAGERPRIVATE_SEARCHDRIVE)
...@@ -167,6 +173,8 @@ class FileManagerPrivateSearchDriveMetadataFunction ...@@ -167,6 +173,8 @@ class FileManagerPrivateSearchDriveMetadataFunction
kOffline, kOffline,
}; };
FileManagerPrivateSearchDriveMetadataFunction();
DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.searchDriveMetadata", DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.searchDriveMetadata",
FILEMANAGERPRIVATE_SEARCHDRIVEMETADATA) FILEMANAGERPRIVATE_SEARCHDRIVEMETADATA)
...@@ -214,6 +222,8 @@ class FileManagerPrivateGetDriveConnectionStateFunction ...@@ -214,6 +222,8 @@ class FileManagerPrivateGetDriveConnectionStateFunction
class FileManagerPrivateRequestAccessTokenFunction class FileManagerPrivateRequestAccessTokenFunction
: public LoggedUIThreadExtensionFunction { : public LoggedUIThreadExtensionFunction {
public: public:
FileManagerPrivateRequestAccessTokenFunction();
DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.requestAccessToken", DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.requestAccessToken",
FILEMANAGERPRIVATE_REQUESTACCESSTOKEN) FILEMANAGERPRIVATE_REQUESTACCESSTOKEN)
...@@ -232,6 +242,8 @@ class FileManagerPrivateRequestAccessTokenFunction ...@@ -232,6 +242,8 @@ class FileManagerPrivateRequestAccessTokenFunction
class FileManagerPrivateInternalRequestDriveShareFunction class FileManagerPrivateInternalRequestDriveShareFunction
: public LoggedUIThreadExtensionFunction { : public LoggedUIThreadExtensionFunction {
public: public:
FileManagerPrivateInternalRequestDriveShareFunction();
DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.requestDriveShare", DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.requestDriveShare",
FILEMANAGERPRIVATEINTERNAL_REQUESTDRIVESHARE) FILEMANAGERPRIVATEINTERNAL_REQUESTDRIVESHARE)
......
...@@ -291,7 +291,7 @@ class FileManagerPrivateCancelCopyFunction ...@@ -291,7 +291,7 @@ class FileManagerPrivateCancelCopyFunction
// Implements the chrome.fileManagerPrivateInternal.resolveIsolatedEntries // Implements the chrome.fileManagerPrivateInternal.resolveIsolatedEntries
// method. // method.
class FileManagerPrivateInternalResolveIsolatedEntriesFunction class FileManagerPrivateInternalResolveIsolatedEntriesFunction
: public UIThreadExtensionFunction { : public LoggedUIThreadExtensionFunction {
public: public:
DECLARE_EXTENSION_FUNCTION( DECLARE_EXTENSION_FUNCTION(
"fileManagerPrivateInternal.resolveIsolatedEntries", "fileManagerPrivateInternal.resolveIsolatedEntries",
...@@ -380,7 +380,7 @@ class FileManagerPrivateIsUMAEnabledFunction ...@@ -380,7 +380,7 @@ class FileManagerPrivateIsUMAEnabledFunction
// Implements the chrome.fileManagerPrivate.setEntryTag method. // Implements the chrome.fileManagerPrivate.setEntryTag method.
class FileManagerPrivateInternalSetEntryTagFunction class FileManagerPrivateInternalSetEntryTagFunction
: public UIThreadExtensionFunction { : public LoggedUIThreadExtensionFunction {
public: public:
FileManagerPrivateInternalSetEntryTagFunction(); FileManagerPrivateInternalSetEntryTagFunction();
DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.setEntryTag", DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.setEntryTag",
......
...@@ -80,6 +80,12 @@ using api::file_manager_private::ProfileInfo; ...@@ -80,6 +80,12 @@ using api::file_manager_private::ProfileInfo;
const char kCWSScope[] = "https://www.googleapis.com/auth/chromewebstore"; const char kCWSScope[] = "https://www.googleapis.com/auth/chromewebstore";
// Thresholds for mountCrostini() API.
constexpr base::TimeDelta kMountCrostiniSlowOperationThreshold =
base::TimeDelta::FromSeconds(10);
constexpr base::TimeDelta kMountCrostiniVerySlowOperationThreshold =
base::TimeDelta::FromSeconds(30);
// Obtains the current app window. // Obtains the current app window.
AppWindow* GetCurrentAppWindow(UIThreadExtensionFunction* function) { AppWindow* GetCurrentAppWindow(UIThreadExtensionFunction* function) {
content::WebContents* const contents = function->GetSenderWebContents(); content::WebContents* const contents = function->GetSenderWebContents();
...@@ -642,7 +648,11 @@ FileManagerPrivateIsCrostiniEnabledFunction::Run() { ...@@ -642,7 +648,11 @@ FileManagerPrivateIsCrostiniEnabledFunction::Run() {
} }
FileManagerPrivateMountCrostiniFunction:: FileManagerPrivateMountCrostiniFunction::
FileManagerPrivateMountCrostiniFunction() = default; FileManagerPrivateMountCrostiniFunction() {
// Mounting crostini shares may require the crostini VM to be started.
SetWarningThresholds(kMountCrostiniSlowOperationThreshold,
kMountCrostiniVerySlowOperationThreshold);
}
FileManagerPrivateMountCrostiniFunction:: FileManagerPrivateMountCrostiniFunction::
~FileManagerPrivateMountCrostiniFunction() = default; ~FileManagerPrivateMountCrostiniFunction() = default;
......
...@@ -249,7 +249,7 @@ class FileManagerPrivateAddProvidedFileSystemFunction ...@@ -249,7 +249,7 @@ class FileManagerPrivateAddProvidedFileSystemFunction
// Implements the chrome.fileManagerPrivate.configureVolume method. // Implements the chrome.fileManagerPrivate.configureVolume method.
class FileManagerPrivateConfigureVolumeFunction class FileManagerPrivateConfigureVolumeFunction
: public UIThreadExtensionFunction { : public LoggedUIThreadExtensionFunction {
public: public:
FileManagerPrivateConfigureVolumeFunction(); FileManagerPrivateConfigureVolumeFunction();
DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.configureVolume", DECLARE_EXTENSION_FUNCTION("fileManagerPrivate.configureVolume",
...@@ -305,7 +305,7 @@ class FileManagerPrivateMountCrostiniFunction ...@@ -305,7 +305,7 @@ class FileManagerPrivateMountCrostiniFunction
// Implements the chrome.fileManagerPrivate.sharePathsWithCrostini // Implements the chrome.fileManagerPrivate.sharePathsWithCrostini
// method. Shares specified paths. // method. Shares specified paths.
class FileManagerPrivateInternalSharePathsWithCrostiniFunction class FileManagerPrivateInternalSharePathsWithCrostiniFunction
: public UIThreadExtensionFunction { : public LoggedUIThreadExtensionFunction {
public: public:
DECLARE_EXTENSION_FUNCTION( DECLARE_EXTENSION_FUNCTION(
"fileManagerPrivateInternal.sharePathsWithCrostini", "fileManagerPrivateInternal.sharePathsWithCrostini",
...@@ -326,7 +326,7 @@ class FileManagerPrivateInternalSharePathsWithCrostiniFunction ...@@ -326,7 +326,7 @@ class FileManagerPrivateInternalSharePathsWithCrostiniFunction
// Implements the chrome.fileManagerPrivate.unsharePathWithCrostini // Implements the chrome.fileManagerPrivate.unsharePathWithCrostini
// method. Unshares specified path. // method. Unshares specified path.
class FileManagerPrivateInternalUnsharePathWithCrostiniFunction class FileManagerPrivateInternalUnsharePathWithCrostiniFunction
: public UIThreadExtensionFunction { : public LoggedUIThreadExtensionFunction {
public: public:
DECLARE_EXTENSION_FUNCTION( DECLARE_EXTENSION_FUNCTION(
"fileManagerPrivateInternal.unsharePathWithCrostini", "fileManagerPrivateInternal.unsharePathWithCrostini",
...@@ -367,7 +367,7 @@ class FileManagerPrivateInternalGetCrostiniSharedPathsFunction ...@@ -367,7 +367,7 @@ class FileManagerPrivateInternalGetCrostiniSharedPathsFunction
// Implements the chrome.fileManagerPrivate.getLinuxPackageInfo method. // Implements the chrome.fileManagerPrivate.getLinuxPackageInfo method.
// Retrieves information about a Linux package. // Retrieves information about a Linux package.
class FileManagerPrivateInternalGetLinuxPackageInfoFunction class FileManagerPrivateInternalGetLinuxPackageInfoFunction
: public UIThreadExtensionFunction { : public LoggedUIThreadExtensionFunction {
public: public:
DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.getLinuxPackageInfo", DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.getLinuxPackageInfo",
FILEMANAGERPRIVATEINTERNAL_GETLINUXPACKAGEINFO) FILEMANAGERPRIVATEINTERNAL_GETLINUXPACKAGEINFO)
...@@ -387,7 +387,7 @@ class FileManagerPrivateInternalGetLinuxPackageInfoFunction ...@@ -387,7 +387,7 @@ class FileManagerPrivateInternalGetLinuxPackageInfoFunction
// Implements the chrome.fileManagerPrivate.installLinuxPackage method. // Implements the chrome.fileManagerPrivate.installLinuxPackage method.
// Starts installation of a Linux package. // Starts installation of a Linux package.
class FileManagerPrivateInternalInstallLinuxPackageFunction class FileManagerPrivateInternalInstallLinuxPackageFunction
: public UIThreadExtensionFunction { : public LoggedUIThreadExtensionFunction {
public: public:
DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.installLinuxPackage", DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.installLinuxPackage",
FILEMANAGERPRIVATEINTERNAL_INSTALLLINUXPACKAGE) FILEMANAGERPRIVATEINTERNAL_INSTALLLINUXPACKAGE)
...@@ -405,7 +405,7 @@ class FileManagerPrivateInternalInstallLinuxPackageFunction ...@@ -405,7 +405,7 @@ class FileManagerPrivateInternalInstallLinuxPackageFunction
// Implements the chrome.fileManagerPrivate.getCustomActions method. // Implements the chrome.fileManagerPrivate.getCustomActions method.
class FileManagerPrivateInternalGetCustomActionsFunction class FileManagerPrivateInternalGetCustomActionsFunction
: public UIThreadExtensionFunction { : public LoggedUIThreadExtensionFunction {
public: public:
FileManagerPrivateInternalGetCustomActionsFunction(); FileManagerPrivateInternalGetCustomActionsFunction();
DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.getCustomActions", DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.getCustomActions",
...@@ -424,7 +424,7 @@ class FileManagerPrivateInternalGetCustomActionsFunction ...@@ -424,7 +424,7 @@ class FileManagerPrivateInternalGetCustomActionsFunction
// Implements the chrome.fileManagerPrivate.executeCustomAction method. // Implements the chrome.fileManagerPrivate.executeCustomAction method.
class FileManagerPrivateInternalExecuteCustomActionFunction class FileManagerPrivateInternalExecuteCustomActionFunction
: public UIThreadExtensionFunction { : public LoggedUIThreadExtensionFunction {
public: public:
FileManagerPrivateInternalExecuteCustomActionFunction(); FileManagerPrivateInternalExecuteCustomActionFunction();
DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.executeCustomAction", DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.executeCustomAction",
...@@ -443,7 +443,7 @@ class FileManagerPrivateInternalExecuteCustomActionFunction ...@@ -443,7 +443,7 @@ class FileManagerPrivateInternalExecuteCustomActionFunction
// Implements the chrome.fileManagerPrivateInternal.getRecentFiles method. // Implements the chrome.fileManagerPrivateInternal.getRecentFiles method.
class FileManagerPrivateInternalGetRecentFilesFunction class FileManagerPrivateInternalGetRecentFilesFunction
: public UIThreadExtensionFunction { : public LoggedUIThreadExtensionFunction {
public: public:
FileManagerPrivateInternalGetRecentFilesFunction(); FileManagerPrivateInternalGetRecentFilesFunction();
DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.getRecentFiles", DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.getRecentFiles",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment