Commit c70ec7ef authored by Oksana Zhuravlova's avatar Oksana Zhuravlova Committed by Commit Bot

Move file, file_path and file_info from common to base

This change moves the file, file path and file_info mojom files from
//mojo/common to //mojo/public/mojom/base. Corresponding typemap
and struct traits file were also moved. Unit tests for file
and file_path were updated to use SerializeAndDeserialize() from
//mojo/public/cpp/test_support/test_utils.h and moved to mojo_unittests.

Bug: 799482
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I18cfd1848b3411ae1524280ed72ae4508b00208e
Reviewed-on: https://chromium-review.googlesource.com/959423
Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarJay Civelli <jcivelli@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542908}
parent 48e2c5b2
...@@ -6,8 +6,8 @@ module ash.mojom; ...@@ -6,8 +6,8 @@ module ash.mojom;
import "ash/public/interfaces/user_info.mojom"; import "ash/public/interfaces/user_info.mojom";
import "components/signin/public/interfaces/account_id.mojom"; import "components/signin/public/interfaces/account_id.mojom";
import "mojo/common/file_path.mojom";
import "mojo/common/time.mojom"; import "mojo/common/time.mojom";
import "mojo/public/mojom/base/file_path.mojom";
import "skia/public/interfaces/bitmap.mojom"; import "skia/public/interfaces/bitmap.mojom";
import "url/mojom/url.mojom"; import "url/mojom/url.mojom";
...@@ -54,9 +54,9 @@ interface WallpaperController { ...@@ -54,9 +54,9 @@ interface WallpaperController {
// |is_device_wallpaper_policy_enforced|: Whether the device wallpaper policy // |is_device_wallpaper_policy_enforced|: Whether the device wallpaper policy
// is enforced on the device. // is enforced on the device.
Init(WallpaperControllerClient client, Init(WallpaperControllerClient client,
mojo.common.mojom.FilePath user_data_path, mojo_base.mojom.FilePath user_data_path,
mojo.common.mojom.FilePath chromeos_wallpapers_path, mojo_base.mojom.FilePath chromeos_wallpapers_path,
mojo.common.mojom.FilePath chromeos_custom_wallpapers_path, mojo_base.mojom.FilePath chromeos_custom_wallpapers_path,
bool is_device_wallpaper_policy_enforced); bool is_device_wallpaper_policy_enforced);
// Sets wallpaper from a local file and updates the saved wallpaper info for // Sets wallpaper from a local file and updates the saved wallpaper info for
...@@ -110,8 +110,8 @@ interface WallpaperController { ...@@ -110,8 +110,8 @@ interface WallpaperController {
// |customized_default_large_path|: The file path of the large-size customized // |customized_default_large_path|: The file path of the large-size customized
// default wallpaper, if any. // default wallpaper, if any.
SetCustomizedDefaultWallpaperPaths( SetCustomizedDefaultWallpaperPaths(
mojo.common.mojom.FilePath customized_default_small_path, mojo_base.mojom.FilePath customized_default_small_path,
mojo.common.mojom.FilePath customized_default_large_path); mojo_base.mojom.FilePath customized_default_large_path);
// Sets wallpaper from policy. If the user has logged in, show the policy // Sets wallpaper from policy. If the user has logged in, show the policy
// wallpaper immediately, otherwise, the policy wallpaper will be shown the // wallpaper immediately, otherwise, the policy wallpaper will be shown the
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
module chrome.mojom; module chrome.mojom;
import "content/public/common/webplugininfo.mojom"; import "content/public/common/webplugininfo.mojom";
import "mojo/common/file_path.mojom"; import "mojo/public/mojom/base/file_path.mojom";
import "mojo/public/mojom/base/string16.mojom"; import "mojo/public/mojom/base/string16.mojom";
import "url/mojom/origin.mojom"; import "url/mojom/origin.mojom";
import "url/mojom/url.mojom"; import "url/mojom/url.mojom";
...@@ -17,7 +17,7 @@ interface PluginHost { ...@@ -17,7 +17,7 @@ interface PluginHost {
ShowFlashPermissionBubble(); ShowFlashPermissionBubble();
// Tells the browser that there was an error loading a plugin. // Tells the browser that there was an error loading a plugin.
CouldNotLoadPlugin(mojo.common.mojom.FilePath file_path); CouldNotLoadPlugin(mojo_base.mojom.FilePath file_path);
// Notifies when a plugin couldn't be loaded because it's outdated. // Notifies when a plugin couldn't be loaded because it's outdated.
BlockedOutdatedPlugin(PluginRenderer plugin_renderer, BlockedOutdatedPlugin(PluginRenderer plugin_renderer,
......
...@@ -19,6 +19,7 @@ source_set("lib") { ...@@ -19,6 +19,7 @@ source_set("lib") {
public_deps = [ public_deps = [
"//chrome/services/file_util/public/mojom", "//chrome/services/file_util/public/mojom",
"//mojo/public/mojom/base",
"//services/service_manager/public/cpp", "//services/service_manager/public/cpp",
] ]
......
...@@ -15,7 +15,7 @@ mojom("mojom") { ...@@ -15,7 +15,7 @@ mojom("mojom") {
} }
public_deps = [ public_deps = [
"//mojo/common:common_custom_types", "//mojo/public/mojom/base",
] ]
if (is_chromeos) { if (is_chromeos) {
......
...@@ -8,25 +8,25 @@ ...@@ -8,25 +8,25 @@
module chrome.mojom; module chrome.mojom;
import "mojo/common/file.mojom"; import "mojo/public/mojom/base/file.mojom";
import "mojo/common/file_path.mojom"; import "mojo/public/mojom/base/file_path.mojom";
interface SafeArchiveAnalyzer { interface SafeArchiveAnalyzer {
// Build flag FULL_SAFE_BROWSING: Analyze the |zip_file| for malicious // Build flag FULL_SAFE_BROWSING: Analyze the |zip_file| for malicious
// download protection, given a |temporary_file| used to extract files // download protection, given a |temporary_file| used to extract files
// from the |zip_file| archive. // from the |zip_file| archive.
AnalyzeZipFile(mojo.common.mojom.File zip_file, AnalyzeZipFile(mojo_base.mojom.File zip_file,
mojo.common.mojom.File temporary_file) mojo_base.mojom.File temporary_file)
=> (SafeArchiveAnalyzerResults results); => (SafeArchiveAnalyzerResults results);
// Build flag FULL_SAFE_BROWSING, on OS_MACOSX: Analyze the |dmg_file| // Build flag FULL_SAFE_BROWSING, on OS_MACOSX: Analyze the |dmg_file|
// for malicious download protection. // for malicious download protection.
AnalyzeDmgFile(mojo.common.mojom.File dmg_file) AnalyzeDmgFile(mojo_base.mojom.File dmg_file)
=> (SafeArchiveAnalyzerResults results); => (SafeArchiveAnalyzerResults results);
// Build flag FULL_SAFE_BROWSING: Analyze the |rar_file| for malicious // Build flag FULL_SAFE_BROWSING: Analyze the |rar_file| for malicious
// download protection. // download protection.
AnalyzeRarFile(mojo.common.mojom.FilePath rar_file) AnalyzeRarFile(mojo_base.mojom.FilePath rar_file)
=> (SafeArchiveAnalyzerResults results); => (SafeArchiveAnalyzerResults results);
}; };
......
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
module chrome.mojom; module chrome.mojom;
import "components/services/filesystem/public/interfaces/directory.mojom"; import "components/services/filesystem/public/interfaces/directory.mojom";
import "mojo/common/file.mojom"; import "mojo/public/mojom/base/file.mojom";
import "mojo/common/file_path.mojom"; import "mojo/public/mojom/base/file_path.mojom";
interface ZipFileCreator { interface ZipFileCreator {
// OS_CHROMEOS: Create a |zip_file| from a list of source files. // OS_CHROMEOS: Create a |zip_file| from a list of source files.
CreateZipFile(filesystem.mojom.Directory source_dir_mojo, CreateZipFile(filesystem.mojom.Directory source_dir_mojo,
mojo.common.mojom.FilePath source_dir, mojo_base.mojom.FilePath source_dir,
array<mojo.common.mojom.FilePath> source_relative_paths, array<mojo_base.mojom.FilePath> source_relative_paths,
mojo.common.mojom.File zip_file) mojo_base.mojom.File zip_file)
=> (bool success); => (bool success);
}; };
...@@ -12,5 +12,6 @@ mojom("mojom") { ...@@ -12,5 +12,6 @@ mojom("mojom") {
public_deps = [ public_deps = [
"//mojo/common:common_custom_types", "//mojo/common:common_custom_types",
"//mojo/public/mojom/base",
] ]
} }
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
module chrome.mojom; module chrome.mojom;
import "mojo/common/file.mojom";
import "mojo/common/time.mojom"; import "mojo/common/time.mojom";
import "mojo/common/values.mojom"; import "mojo/common/values.mojom";
import "mojo/public/mojom/base/file.mojom";
interface MediaParser { interface MediaParser {
// Extracts metadata from a |mime_type| blob of data of |total_size| and // Extracts metadata from a |mime_type| blob of data of |total_size| and
...@@ -27,7 +27,7 @@ interface MediaParser { ...@@ -27,7 +27,7 @@ interface MediaParser {
// Note: it is still not safe to decode the file in the calling process after // Note: it is still not safe to decode the file in the calling process after
// this check. // this check.
CheckMediaFile(mojo.common.mojom.TimeDelta decode_time, CheckMediaFile(mojo.common.mojom.TimeDelta decode_time,
mojo.common.mojom.File file) mojo_base.mojom.File file)
=> (bool success); => (bool success);
}; };
......
...@@ -11,6 +11,6 @@ mojom("mojom") { ...@@ -11,6 +11,6 @@ mojom("mojom") {
] ]
public_deps = [ public_deps = [
"//mojo/common:common_custom_types", "//mojo/public/mojom/base",
] ]
} }
...@@ -4,22 +4,22 @@ ...@@ -4,22 +4,22 @@
module chrome.mojom; module chrome.mojom;
import "mojo/common/file_path.mojom"; import "mojo/public/mojom/base/file_path.mojom";
interface RemovableStorageWriter { interface RemovableStorageWriter {
const string kTestDevice = "chrome://test-removable-storage-writer"; const string kTestDevice = "chrome://test-removable-storage-writer";
// Writes the content of the source file to the target. The target file is // Writes the content of the source file to the target. The target file is
// restricted to removable drives by the utility process. // restricted to removable drives by the utility process.
Write(mojo.common.mojom.FilePath source, Write(mojo_base.mojom.FilePath source,
mojo.common.mojom.FilePath target, mojo_base.mojom.FilePath target,
RemovableStorageWriterClient client); RemovableStorageWriterClient client);
// Verifies that the contents of the source file was written to the target // Verifies that the contents of the source file was written to the target
// file. Again, the target is restricted to removable drives by the utility // file. Again, the target is restricted to removable drives by the utility
// process. // process.
Verify(mojo.common.mojom.FilePath source, Verify(mojo_base.mojom.FilePath source,
mojo.common.mojom.FilePath target, mojo_base.mojom.FilePath target,
RemovableStorageWriterClient client); RemovableStorageWriterClient client);
}; };
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
module chrome.mojom; module chrome.mojom;
import "mojo/common/file_path.mojom"; import "mojo/public/mojom/base/file_path.mojom";
import "mojo/public/mojom/base/string16.mojom"; import "mojo/public/mojom/base/string16.mojom";
interface ShellUtilWin { interface ShellUtilWin {
...@@ -27,10 +27,10 @@ interface ShellUtilWin { ...@@ -27,10 +27,10 @@ interface ShellUtilWin {
CallGetOpenFileName(uint32 owner, CallGetOpenFileName(uint32 owner,
uint32 flags, uint32 flags,
FileExtensionFilters filters, FileExtensionFilters filters,
mojo.common.mojom.FilePath initial_directory, mojo_base.mojom.FilePath initial_directory,
mojo.common.mojom.FilePath initial_filename) => mojo_base.mojom.FilePath initial_filename) =>
(mojo.common.mojom.FilePath directory, (mojo_base.mojom.FilePath directory,
array<mojo.common.mojom.FilePath> files); array<mojo_base.mojom.FilePath> files);
// Calls OS_WIN ::GetSaveFileName() with parameters: // Calls OS_WIN ::GetSaveFileName() with parameters:
// |owner| HWND to use as the parent of the modal dialog. // |owner| HWND to use as the parent of the modal dialog.
...@@ -49,10 +49,10 @@ interface ShellUtilWin { ...@@ -49,10 +49,10 @@ interface ShellUtilWin {
uint32 flags, uint32 flags,
FileExtensionFilters filters, FileExtensionFilters filters,
uint32 one_based_filter_index, uint32 one_based_filter_index,
mojo.common.mojom.FilePath initial_directory, mojo_base.mojom.FilePath initial_directory,
mojo.common.mojom.FilePath suggested_filename, mojo_base.mojom.FilePath suggested_filename,
mojo_base.mojom.String16 default_extension) => mojo_base.mojom.String16 default_extension) =>
(mojo.common.mojom.FilePath path, (mojo_base.mojom.FilePath path,
uint32 filter_index); uint32 filter_index);
}; };
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
module firefox_importer_unittest_utils_mac.mojom; module firefox_importer_unittest_utils_mac.mojom;
import "components/autofill/content/common/autofill_types.mojom"; import "components/autofill/content/common/autofill_types.mojom";
import "mojo/common/file_path.mojom"; import "mojo/public/mojom/base/file_path.mojom";
import "mojo/public/mojom/base/string16.mojom"; import "mojo/public/mojom/base/string16.mojom";
// Used for tests only. Decrypts the firefox database in a child process. // Used for tests only. Decrypts the firefox database in a child process.
...@@ -13,11 +13,11 @@ import "mojo/public/mojom/base/string16.mojom"; ...@@ -13,11 +13,11 @@ import "mojo/public/mojom/base/string16.mojom";
interface FirefoxDecryptor { interface FirefoxDecryptor {
// Should be called before Decrypt and ParseSignons. |dll_path| should point // Should be called before Decrypt and ParseSignons. |dll_path| should point
// to a directory where nss3 lib resides. // to a directory where nss3 lib resides.
Init(mojo.common.mojom.FilePath dll_path, mojo.common.mojom.FilePath db_path) Init(mojo_base.mojom.FilePath dll_path, mojo_base.mojom.FilePath db_path)
=> (bool result); => (bool result);
Decrypt(string crypt) => (mojo_base.mojom.String16 decrypted); Decrypt(string crypt) => (mojo_base.mojom.String16 decrypted);
// Parses the Firefox sqlite passwords database and returns the list of // Parses the Firefox sqlite passwords database and returns the list of
// credentials. // credentials.
ParseSignons(mojo.common.mojom.FilePath sqlite_file) => ParseSignons(mojo_base.mojom.FilePath sqlite_file) =>
(array<autofill.mojom.PasswordForm> parsed_vector); (array<autofill.mojom.PasswordForm> parsed_vector);
}; };
...@@ -11,6 +11,7 @@ mojom("call_stack_mojo_bindings") { ...@@ -11,6 +11,7 @@ mojom("call_stack_mojo_bindings") {
deps = [ deps = [
"//mojo/common:common_custom_types", "//mojo/common:common_custom_types",
"//mojo/public/mojom/base",
] ]
} }
......
...@@ -4,15 +4,15 @@ ...@@ -4,15 +4,15 @@
module metrics.mojom; module metrics.mojom;
import "mojo/common/file_path.mojom";
import "mojo/common/time.mojom"; import "mojo/common/time.mojom";
import "mojo/public/mojom/base/file_path.mojom";
// These structs mirror the corresponding types in base::StackSamplingProfiler. // These structs mirror the corresponding types in base::StackSamplingProfiler.
struct CallStackModule { struct CallStackModule {
uint64 base_address; uint64 base_address;
string id; string id;
mojo.common.mojom.FilePath filename; mojo_base.mojom.FilePath filename;
}; };
struct CallStackFrame { struct CallStackFrame {
......
...@@ -11,7 +11,7 @@ mojom("interfaces") { ...@@ -11,7 +11,7 @@ mojom("interfaces") {
public_deps = [ public_deps = [
":constants", ":constants",
"//mojo/common:common_custom_types", "//mojo/public/mojom/base",
] ]
} }
......
...@@ -4,22 +4,22 @@ ...@@ -4,22 +4,22 @@
module patch.mojom; module patch.mojom;
import "mojo/common/file.mojom"; import "mojo/public/mojom/base/file.mojom";
interface FilePatcher { interface FilePatcher {
// Patch |input_file| with |patch_file| using the bsdiff algorithm // Patch |input_file| with |patch_file| using the bsdiff algorithm
// (Courgette's version) and place the output in |output_file|. // (Courgette's version) and place the output in |output_file|.
// Returns |result| bsdiff::BSDiffStatus::OK on success. // Returns |result| bsdiff::BSDiffStatus::OK on success.
PatchFileBsdiff( PatchFileBsdiff(
mojo.common.mojom.File input_file, mojo_base.mojom.File input_file,
mojo.common.mojom.File patch_file, mojo_base.mojom.File patch_file,
mojo.common.mojom.File output_file) => (int32 result); mojo_base.mojom.File output_file) => (int32 result);
// Patch |input_file| with |patch_file| using the Courgette algorithm // Patch |input_file| with |patch_file| using the Courgette algorithm
// and place the output in |output_file|. // and place the output in |output_file|.
// Returns |result| courgette::Status::C_OK on success. // Returns |result| courgette::Status::C_OK on success.
PatchFileCourgette( PatchFileCourgette(
mojo.common.mojom.File input_file, mojo_base.mojom.File input_file,
mojo.common.mojom.File patch_file, mojo_base.mojom.File patch_file,
mojo.common.mojom.File output_file) => (int32 result); mojo_base.mojom.File output_file) => (int32 result);
}; };
...@@ -6,7 +6,7 @@ module filesystem.mojom; ...@@ -6,7 +6,7 @@ module filesystem.mojom;
import "components/services/filesystem/public/interfaces/file.mojom"; import "components/services/filesystem/public/interfaces/file.mojom";
import "components/services/filesystem/public/interfaces/types.mojom"; import "components/services/filesystem/public/interfaces/types.mojom";
import "mojo/common/file.mojom"; import "mojo/public/mojom/base/file.mojom";
import "mojo/public/mojom/base/file_error.mojom"; import "mojo/public/mojom/base/file_error.mojom";
struct FileOpenDetails { struct FileOpenDetails {
...@@ -17,7 +17,7 @@ struct FileOpenDetails { ...@@ -17,7 +17,7 @@ struct FileOpenDetails {
struct FileOpenResult { struct FileOpenResult {
string path; string path;
mojo_base.mojom.FileError error; mojo_base.mojom.FileError error;
mojo.common.mojom.File? file_handle; mojo_base.mojom.File? file_handle;
}; };
// This interface provides access to a directory in a "file system", providing // This interface provides access to a directory in a "file system", providing
...@@ -50,7 +50,7 @@ interface Directory { ...@@ -50,7 +50,7 @@ interface Directory {
[Sync] [Sync]
OpenFileHandle(string path, uint32 open_flags) OpenFileHandle(string path, uint32 open_flags)
=> (mojo_base.mojom.FileError error, => (mojo_base.mojom.FileError error,
mojo.common.mojom.File? file_handle); mojo_base.mojom.File? file_handle);
// Like OpenFileHandle, but opens multiple files. // Like OpenFileHandle, but opens multiple files.
[Sync] [Sync]
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
module filesystem.mojom; module filesystem.mojom;
import "components/services/filesystem/public/interfaces/types.mojom"; import "components/services/filesystem/public/interfaces/types.mojom";
import "mojo/common/file.mojom"; import "mojo/public/mojom/base/file.mojom";
import "mojo/public/mojom/base/file_error.mojom"; import "mojo/public/mojom/base/file_error.mojom";
// TODO(vtl): Write comments. // TODO(vtl): Write comments.
...@@ -90,5 +90,5 @@ interface File { ...@@ -90,5 +90,5 @@ interface File {
// Returns a handle to the file for raw access. // Returns a handle to the file for raw access.
[Sync] [Sync]
AsHandle() => (mojo_base.mojom.FileError error, AsHandle() => (mojo_base.mojom.FileError error,
mojo.common.mojom.File? file_handle); mojo_base.mojom.File? file_handle);
}; };
...@@ -11,6 +11,6 @@ mojom("interfaces") { ...@@ -11,6 +11,6 @@ mojom("interfaces") {
] ]
public_deps = [ public_deps = [
"//mojo/common:common_custom_types", "//mojo/public/mojom/base",
] ]
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
module font_service.mojom; module font_service.mojom;
import "mojo/common/file.mojom"; import "mojo/public/mojom/base/file.mojom";
enum TypefaceSlant { enum TypefaceSlant {
ROMAN = 0, ROMAN = 0,
...@@ -44,5 +44,5 @@ interface FontService { ...@@ -44,5 +44,5 @@ interface FontService {
(FontIdentity? identity, string family_name, TypefaceStyle style); (FontIdentity? identity, string family_name, TypefaceStyle style);
// Returns a handle to the raw font specified by |id_number|. // Returns a handle to the raw font specified by |id_number|.
OpenStream(uint32 id_number) => (mojo.common.mojom.File? font_handle); OpenStream(uint32 id_number) => (mojo_base.mojom.File? font_handle);
}; };
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
module spellcheck.mojom; module spellcheck.mojom;
import "mojo/common/file.mojom"; import "mojo/public/mojom/base/file.mojom";
import "mojo/public/mojom/base/string16.mojom"; import "mojo/public/mojom/base/string16.mojom";
// Render process interface exposed to the browser for receiving process- // Render process interface exposed to the browser for receiving process-
...@@ -25,7 +25,7 @@ interface SpellChecker { ...@@ -25,7 +25,7 @@ interface SpellChecker {
}; };
struct SpellCheckBDictLanguage { struct SpellCheckBDictLanguage {
mojo.common.mojom.File? file; mojo_base.mojom.File? file;
string language; string language;
}; };
......
...@@ -12,7 +12,7 @@ mojom("interfaces") { ...@@ -12,7 +12,7 @@ mojom("interfaces") {
public_deps = [ public_deps = [
":constants", ":constants",
"//components/services/filesystem/public/interfaces", "//components/services/filesystem/public/interfaces",
"//mojo/common:common_custom_types", "//mojo/public/mojom/base",
] ]
} }
......
...@@ -4,25 +4,25 @@ ...@@ -4,25 +4,25 @@
module unzip.mojom; module unzip.mojom;
import "mojo/common/file.mojom";
import "mojo/common/file_path.mojom";
import "components/services/filesystem/public/interfaces/directory.mojom"; import "components/services/filesystem/public/interfaces/directory.mojom";
import "mojo/public/mojom/base/file.mojom";
import "mojo/public/mojom/base/file_path.mojom";
interface UnzipFilter { interface UnzipFilter {
[Sync] [Sync]
ShouldUnzipFile(mojo.common.mojom.FilePath path) => (bool result); ShouldUnzipFile(mojo_base.mojom.FilePath path) => (bool result);
}; };
interface Unzipper { interface Unzipper {
// Unzip |zip_file| into |output_dir|. // Unzip |zip_file| into |output_dir|.
// Returns true on success, false otherwise. // Returns true on success, false otherwise.
Unzip(mojo.common.mojom.File zip_file, filesystem.mojom.Directory output_dir) Unzip(mojo_base.mojom.File zip_file, filesystem.mojom.Directory output_dir)
=> (bool result); => (bool result);
// Same as |unzip| but only includes the files for which |filter| returns // Same as |unzip| but only includes the files for which |filter| returns
// true. Note that this incurs one IPC for each file of the archive. // true. Note that this incurs one IPC for each file of the archive.
UnzipWithFilter( UnzipWithFilter(
mojo.common.mojom.File zip_file, mojo_base.mojom.File zip_file,
filesystem.mojom.Directory output_dir, filesystem.mojom.Directory output_dir,
UnzipFilter filter) => (bool result); UnzipFilter filter) => (bool result);
}; };
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
module content.mojom; module content.mojom;
import "mojo/common/file.mojom"; import "mojo/public/mojom/base/file.mojom";
import "mojo/common/file_path.mojom"; import "mojo/public/mojom/base/file_path.mojom";
import "mojo/public/mojom/base/string16.mojom"; import "mojo/public/mojom/base/string16.mojom";
struct DWriteStringPair { struct DWriteStringPair {
...@@ -47,8 +47,8 @@ interface DWriteFontProxy { ...@@ -47,8 +47,8 @@ interface DWriteFontProxy {
// contain font data for the font family at the specified index. // contain font data for the font family at the specified index.
[Sync] [Sync]
GetFontFiles(uint32 family_index) GetFontFiles(uint32 family_index)
=> (array<mojo.common.mojom.FilePath> file_paths, => (array<mojo_base.mojom.FilePath> file_paths,
array<mojo.common.mojom.File> file_handles); array<mojo_base.mojom.File> file_handles);
// Locates a font family that is able to render the specified text using the // Locates a font family that is able to render the specified text using the
// specified style. If successful, the family_index and family_name will // specified style. If successful, the family_index and family_name will
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
module content.mojom; module content.mojom;
import "mojo/common/file_info.mojom"; import "mojo/public/mojom/base/file_info.mojom";
import "mojo/common/file_path.mojom"; import "mojo/public/mojom/base/file_path.mojom";
// File utilities messages sent from the renderer to the browser. // File utilities messages sent from the renderer to the browser.
interface FileUtilitiesHost { interface FileUtilitiesHost {
[Sync] [Sync]
GetFileInfo(mojo.common.mojom.FilePath path) => ( GetFileInfo(mojo_base.mojom.FilePath path) => (
mojo.common.mojom.FileInfo? result); mojo_base.mojom.FileInfo? result);
}; };
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
module indexed_db.mojom; module indexed_db.mojom;
import "mojo/common/file_path.mojom";
import "mojo/public/mojom/base/string16.mojom";
import "mojo/common/time.mojom"; import "mojo/common/time.mojom";
import "mojo/public/mojom/base/file_path.mojom";
import "mojo/public/mojom/base/string16.mojom";
import "third_party/WebKit/public/mojom/blob/blob.mojom"; import "third_party/WebKit/public/mojom/blob/blob.mojom";
import "url/mojom/origin.mojom"; import "url/mojom/origin.mojom";
...@@ -131,7 +131,7 @@ struct IndexKeys { ...@@ -131,7 +131,7 @@ struct IndexKeys {
}; };
struct FileInfo { struct FileInfo {
mojo.common.mojom.FilePath path; mojo_base.mojom.FilePath path;
mojo_base.mojom.String16 name; mojo_base.mojom.String16 name;
mojo.common.mojom.Time last_modified; mojo.common.mojom.Time last_modified;
}; };
......
...@@ -820,7 +820,7 @@ mojom("mojo_bindings") { ...@@ -820,7 +820,7 @@ mojom("mojo_bindings") {
"common/power_monitor_test.mojom", "common/power_monitor_test.mojom",
] ]
public_deps = [ public_deps = [
"//mojo/common:common_custom_types", "//mojo/public/mojom/base",
"//ui/gfx/geometry/mojo", "//ui/gfx/geometry/mojo",
"//url/mojom:url_mojom_gurl", "//url/mojom:url_mojom_gurl",
] ]
......
...@@ -4,19 +4,19 @@ ...@@ -4,19 +4,19 @@
module content.mojom; module content.mojom;
import "mojo/common/file_path.mojom"; import "mojo/public/mojom/base/file_path.mojom";
import "ui/gfx/geometry/mojo/geometry.mojom"; import "ui/gfx/geometry/mojo/geometry.mojom";
import "url/mojom/url.mojom"; import "url/mojom/url.mojom";
struct ShellTestConfiguration { struct ShellTestConfiguration {
// The current working directory. // The current working directory.
mojo.common.mojom.FilePath current_working_directory; mojo_base.mojom.FilePath current_working_directory;
// The temporary directory of the system. // The temporary directory of the system.
mojo.common.mojom.FilePath temp_path; mojo_base.mojom.FilePath temp_path;
// The build directory. // The build directory.
mojo.common.mojom.FilePath build_directory; mojo_base.mojom.FilePath build_directory;
// The URL of the current layout test. // The URL of the current layout test.
url.mojom.Url test_url; url.mojom.Url test_url;
......
...@@ -314,9 +314,9 @@ maliciously passed around. ...@@ -314,9 +314,9 @@ maliciously passed around.
Where possible, use structured types: this allows the type system to help Where possible, use structured types: this allows the type system to help
enforce that the input data is valid. Common ones to watch out for: enforce that the input data is valid. Common ones to watch out for:
* Files: use `mojo.common.mojom.File`, not raw descriptor types like `HANDLE` * Files: use `mojo_base.mojom.File`, not raw descriptor types like `HANDLE`
and `int`. and `int`.
* File paths: use `mojo.common.mojom.FilePath`, not `string`. * File paths: use `mojo_base.mojom.FilePath`, not `string`.
* JSON: use `mojo.common.mojom.Value`, not `string`. * JSON: use `mojo.common.mojom.Value`, not `string`.
* Mojo interfaces: use `Interface` or `Interface&`, not `handle` or * Mojo interfaces: use `Interface` or `Interface&`, not `handle` or
`handle<message_pipe>`. `handle<message_pipe>`.
......
...@@ -34,6 +34,7 @@ if (enable_extensions) { ...@@ -34,6 +34,7 @@ if (enable_extensions) {
public_deps = [ public_deps = [
"//content/public/common:interfaces", "//content/public/common:interfaces",
"//mojo/public/mojom/base",
"//ui/gfx/geometry/mojo", "//ui/gfx/geometry/mojo",
"//url/mojom:url_mojom_gurl", "//url/mojom:url_mojom_gurl",
] ]
......
...@@ -49,6 +49,7 @@ mojom("interfaces") { ...@@ -49,6 +49,7 @@ mojom("interfaces") {
public_deps = [ public_deps = [
"//gpu/ipc/common:interfaces", "//gpu/ipc/common:interfaces",
"//mojo/common:common_custom_types", "//mojo/common:common_custom_types",
"//mojo/public/mojom/base",
"//services/service_manager/public/mojom", "//services/service_manager/public/mojom",
"//ui/gfx/geometry/mojo", "//ui/gfx/geometry/mojo",
"//url/mojom:url_mojom_gurl", "//url/mojom:url_mojom_gurl",
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
module media.mojom; module media.mojom;
import "media/mojo/interfaces/content_decryption_module.mojom"; import "media/mojo/interfaces/content_decryption_module.mojom";
import "mojo/common/file_path.mojom"; import "mojo/public/mojom/base/file_path.mojom";
import "services/service_manager/public/mojom/interface_provider.mojom"; import "services/service_manager/public/mojom/interface_provider.mojom";
[EnableIf=is_mac] [EnableIf=is_mac]
...@@ -24,7 +24,7 @@ interface CdmService { ...@@ -24,7 +24,7 @@ interface CdmService {
// |token_provider| can be used to get a sandbox seatbelt extension token // |token_provider| can be used to get a sandbox seatbelt extension token
// synchronously so that the CdmService instance can load the CDM and other // synchronously so that the CdmService instance can load the CDM and other
// needed files within the Mac sandbox. // needed files within the Mac sandbox.
LoadCdm(mojo.common.mojom.FilePath cdm_path, LoadCdm(mojo_base.mojom.FilePath cdm_path,
[EnableIf=is_mac] [EnableIf=is_mac]
SeatbeltExtensionTokenProvider? token_provider); SeatbeltExtensionTokenProvider? token_provider);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
module media.mojom; module media.mojom;
import "mojo/common/file.mojom"; import "mojo/public/mojom/base/file.mojom";
// Provides a way to organize persistent per-origin/per-cdm-type data // Provides a way to organize persistent per-origin/per-cdm-type data
// in the browser's file system. // in the browser's file system.
...@@ -29,7 +29,7 @@ interface CdmStorage { ...@@ -29,7 +29,7 @@ interface CdmStorage {
// |status| == kFailure is returned. // |status| == kFailure is returned.
Open(string file_name) Open(string file_name)
=> (Status status, => (Status status,
mojo.common.mojom.File? file_for_reading, mojo_base.mojom.File? file_for_reading,
associated CdmFile? cdm_file); associated CdmFile? cdm_file);
}; };
...@@ -47,10 +47,10 @@ interface CdmFile { ...@@ -47,10 +47,10 @@ interface CdmFile {
// Open a new file that can be written to. This file will be in the same // Open a new file that can be written to. This file will be in the same
// directory as the original file. If successful, returns |file_for_writing| // directory as the original file. If successful, returns |file_for_writing|
// which can be written to. // which can be written to.
OpenFileForWriting() => (mojo.common.mojom.File? file_for_writing); OpenFileForWriting() => (mojo_base.mojom.File? file_for_writing);
// Closes the file opened for writing and replaces the original file. // Closes the file opened for writing and replaces the original file.
// Returns a new file descriptor that should be used to read the original // Returns a new file descriptor that should be used to read the original
// file from now on. // file from now on.
CommitWrite() => (mojo.common.mojom.File? updated_file_for_reading); CommitWrite() => (mojo_base.mojom.File? updated_file_for_reading);
}; };
...@@ -14,9 +14,6 @@ group("common") { ...@@ -14,9 +14,6 @@ group("common") {
mojom("common_custom_types") { mojom("common_custom_types") {
sources = [ sources = [
"file.mojom",
"file_info.mojom",
"file_path.mojom",
"memory_allocator_dump_cross_process_uid.mojom", "memory_allocator_dump_cross_process_uid.mojom",
"process_id.mojom", "process_id.mojom",
"text_direction.mojom", "text_direction.mojom",
......
...@@ -43,24 +43,6 @@ bool StructTraits< ...@@ -43,24 +43,6 @@ bool StructTraits<
return true; return true;
} }
mojo::ScopedHandle StructTraits<common::mojom::FileDataView, base::File>::fd(
base::File& file) {
DCHECK(file.IsValid());
return mojo::WrapPlatformFile(file.TakePlatformFile());
}
bool StructTraits<common::mojom::FileDataView, base::File>::Read(
common::mojom::FileDataView data,
base::File* file) {
base::PlatformFile platform_handle = base::kInvalidPlatformFile;
if (mojo::UnwrapPlatformFile(data.TakeFd(), &platform_handle) !=
MOJO_RESULT_OK) {
return false;
}
*file = base::File(platform_handle);
return true;
}
// static // static
common::mojom::TextDirection common::mojom::TextDirection
EnumTraits<common::mojom::TextDirection, base::i18n::TextDirection>::ToMojom( EnumTraits<common::mojom::TextDirection, base::i18n::TextDirection>::ToMojom(
......
...@@ -5,14 +5,12 @@ ...@@ -5,14 +5,12 @@
#ifndef MOJO_COMMON_COMMON_CUSTOM_TYPES_STRUCT_TRAITS_H_ #ifndef MOJO_COMMON_COMMON_CUSTOM_TYPES_STRUCT_TRAITS_H_
#define MOJO_COMMON_COMMON_CUSTOM_TYPES_STRUCT_TRAITS_H_ #define MOJO_COMMON_COMMON_CUSTOM_TYPES_STRUCT_TRAITS_H_
#include "base/files/file.h"
#include "base/i18n/rtl.h" #include "base/i18n/rtl.h"
#include "base/process/process_handle.h" #include "base/process/process_handle.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/trace_event/memory_allocator_dump_guid.h" #include "base/trace_event/memory_allocator_dump_guid.h"
#include "base/unguessable_token.h" #include "base/unguessable_token.h"
#include "base/version.h" #include "base/version.h"
#include "mojo/common/file.mojom-shared.h"
#include "mojo/common/memory_allocator_dump_cross_process_uid.mojom-shared.h" #include "mojo/common/memory_allocator_dump_cross_process_uid.mojom-shared.h"
#include "mojo/common/mojo_common_export.h" #include "mojo/common/mojo_common_export.h"
#include "mojo/common/process_id.mojom-shared.h" #include "mojo/common/process_id.mojom-shared.h"
...@@ -68,16 +66,6 @@ struct StructTraits<common::mojom::ProcessIdDataView, base::ProcessId> { ...@@ -68,16 +66,6 @@ struct StructTraits<common::mojom::ProcessIdDataView, base::ProcessId> {
} }
}; };
template <>
struct StructTraits<common::mojom::FileDataView, base::File> {
static bool IsNull(const base::File& file) { return !file.IsValid(); }
static void SetToNull(base::File* file) { *file = base::File(); }
static mojo::ScopedHandle fd(base::File& file);
static bool Read(common::mojom::FileDataView data, base::File* file);
};
template <> template <>
struct EnumTraits<common::mojom::TextDirection, base::i18n::TextDirection> { struct EnumTraits<common::mojom::TextDirection, base::i18n::TextDirection> {
static common::mojom::TextDirection ToMojom( static common::mojom::TextDirection ToMojom(
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/numerics/safe_math.h" #include "base/numerics/safe_math.h"
...@@ -63,21 +61,6 @@ base::Callback<void(typename PassTraits<T>::Type)> ExpectResponse( ...@@ -63,21 +61,6 @@ base::Callback<void(typename PassTraits<T>::Type)> ExpectResponse(
return base::Bind(&DoExpectResponse<T>, expected_value, closure); return base::Bind(&DoExpectResponse<T>, expected_value, closure);
} }
class TestFilePathImpl : public TestFilePath {
public:
explicit TestFilePathImpl(TestFilePathRequest request)
: binding_(this, std::move(request)) {}
// TestFilePath implementation:
void BounceFilePath(const base::FilePath& in,
BounceFilePathCallback callback) override {
std::move(callback).Run(in);
}
private:
mojo::Binding<TestFilePath> binding_;
};
class TestUnguessableTokenImpl : public TestUnguessableToken { class TestUnguessableTokenImpl : public TestUnguessableToken {
public: public:
explicit TestUnguessableTokenImpl(TestUnguessableTokenRequest request) explicit TestUnguessableTokenImpl(TestUnguessableTokenRequest request)
...@@ -142,20 +125,6 @@ class TestValueImpl : public TestValue { ...@@ -142,20 +125,6 @@ class TestValueImpl : public TestValue {
mojo::Binding<TestValue> binding_; mojo::Binding<TestValue> binding_;
}; };
class TestFileImpl : public TestFile {
public:
explicit TestFileImpl(TestFileRequest request)
: binding_(this, std::move(request)) {}
// TestFile implementation:
void BounceFile(base::File in, BounceFileCallback callback) override {
std::move(callback).Run(std::move(in));
}
private:
mojo::Binding<TestFile> binding_;
};
class TestTextDirectionImpl : public TestTextDirection { class TestTextDirectionImpl : public TestTextDirection {
public: public:
explicit TestTextDirectionImpl(TestTextDirectionRequest request) explicit TestTextDirectionImpl(TestTextDirectionRequest request)
...@@ -184,20 +153,6 @@ class CommonCustomTypesTest : public testing::Test { ...@@ -184,20 +153,6 @@ class CommonCustomTypesTest : public testing::Test {
} // namespace } // namespace
TEST_F(CommonCustomTypesTest, FilePath) {
base::RunLoop run_loop;
TestFilePathPtr ptr;
TestFilePathImpl impl(MakeRequest(&ptr));
base::FilePath dir(FILE_PATH_LITERAL("hello"));
base::FilePath file = dir.Append(FILE_PATH_LITERAL("world"));
ptr->BounceFilePath(file, ExpectResponse(&file, run_loop.QuitClosure()));
run_loop.Run();
}
TEST_F(CommonCustomTypesTest, UnguessableToken) { TEST_F(CommonCustomTypesTest, UnguessableToken) {
base::RunLoop run_loop; base::RunLoop run_loop;
...@@ -337,49 +292,6 @@ TEST_F(CommonCustomTypesTest, Value) { ...@@ -337,49 +292,6 @@ TEST_F(CommonCustomTypesTest, Value) {
ASSERT_EQ(*input, *output); ASSERT_EQ(*input, *output);
} }
TEST_F(CommonCustomTypesTest, File) {
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
TestFilePtr ptr;
TestFileImpl impl(MakeRequest(&ptr));
base::File file(
temp_dir.GetPath().AppendASCII("test_file.txt"),
base::File::FLAG_CREATE | base::File::FLAG_WRITE | base::File::FLAG_READ);
const base::StringPiece test_content =
"A test string to be stored in a test file";
file.WriteAtCurrentPos(
test_content.data(),
base::CheckedNumeric<int>(test_content.size()).ValueOrDie());
base::File file_out;
ASSERT_TRUE(ptr->BounceFile(std::move(file), &file_out));
std::vector<char> content(test_content.size());
ASSERT_TRUE(file_out.IsValid());
ASSERT_EQ(static_cast<int>(test_content.size()),
file_out.Read(
0, content.data(),
base::CheckedNumeric<int>(test_content.size()).ValueOrDie()));
EXPECT_EQ(test_content,
base::StringPiece(content.data(), test_content.size()));
}
TEST_F(CommonCustomTypesTest, InvalidFile) {
TestFilePtr ptr;
TestFileImpl impl(MakeRequest(&ptr));
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
// Test that |file_out| is set to an invalid file.
base::File file_out(
temp_dir.GetPath().AppendASCII("test_file.txt"),
base::File::FLAG_CREATE | base::File::FLAG_WRITE | base::File::FLAG_READ);
ASSERT_TRUE(ptr->BounceFile(base::File(), &file_out));
EXPECT_FALSE(file_out.IsValid());
}
TEST_F(CommonCustomTypesTest, TextDirection) { TEST_F(CommonCustomTypesTest, TextDirection) {
base::i18n::TextDirection kTestDirections[] = {base::i18n::LEFT_TO_RIGHT, base::i18n::TextDirection kTestDirections[] = {base::i18n::LEFT_TO_RIGHT,
base::i18n::RIGHT_TO_LEFT, base::i18n::RIGHT_TO_LEFT,
......
...@@ -4,18 +4,11 @@ ...@@ -4,18 +4,11 @@
module mojo.common.test; module mojo.common.test;
import "mojo/common/file.mojom";
import "mojo/common/file_path.mojom";
import "mojo/common/text_direction.mojom"; import "mojo/common/text_direction.mojom";
import "mojo/common/time.mojom"; import "mojo/common/time.mojom";
import "mojo/common/unguessable_token.mojom"; import "mojo/common/unguessable_token.mojom";
import "mojo/common/values.mojom"; import "mojo/common/values.mojom";
interface TestFilePath {
BounceFilePath(mojo.common.mojom.FilePath in)
=> (mojo.common.mojom.FilePath out);
};
interface TestUnguessableToken { interface TestUnguessableToken {
BounceNonce(mojo.common.mojom.UnguessableToken in) BounceNonce(mojo.common.mojom.UnguessableToken in)
=> (mojo.common.mojom.UnguessableToken out); => (mojo.common.mojom.UnguessableToken out);
...@@ -41,12 +34,6 @@ interface TestValue { ...@@ -41,12 +34,6 @@ interface TestValue {
=> (mojo.common.mojom.Value? out); => (mojo.common.mojom.Value? out);
}; };
interface TestFile {
[Sync]
BounceFile(mojo.common.mojom.File? in)
=> (mojo.common.mojom.File? out);
};
interface TestTextDirection { interface TestTextDirection {
[Sync] [Sync]
BounceTextDirection(mojo.common.mojom.TextDirection in) BounceTextDirection(mojo.common.mojom.TextDirection in)
......
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
# found in the LICENSE file. # found in the LICENSE file.
typemaps = [ typemaps = [
"//mojo/common/file.typemap",
"//mojo/common/file_info.typemap",
"//mojo/common/file_path.typemap",
"//mojo/common/logfont_win.typemap", "//mojo/common/logfont_win.typemap",
"//mojo/common/memory_allocator_dump_cross_process_uid.typemap", "//mojo/common/memory_allocator_dump_cross_process_uid.typemap",
"//mojo/common/process_id.typemap", "//mojo/common/process_id.typemap",
......
...@@ -46,6 +46,8 @@ source_set("tests") { ...@@ -46,6 +46,8 @@ source_set("tests") {
sources = [ sources = [
"big_buffer_unittest.cc", "big_buffer_unittest.cc",
"big_string_unittest.cc", "big_string_unittest.cc",
"file_path_unittest.cc",
"file_unittest.cc",
"ref_counted_memory_unittest.cc", "ref_counted_memory_unittest.cc",
"string16_unittest.cc", "string16_unittest.cc",
] ]
......
...@@ -2,12 +2,13 @@ ...@@ -2,12 +2,13 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
mojom = "//mojo/common/file.mojom" mojom = "//mojo/public/mojom/base/file.mojom"
public_headers = [ "//base/files/file.h" ] public_headers = [ "//base/files/file.h" ]
traits_headers = [ "//mojo/common/common_custom_types_struct_traits.h" ] traits_headers = [ "//mojo/public/cpp/base/file_mojom_traits.h" ]
public_deps = [ sources = [
"//mojo/common:struct_traits", "//mojo/public/cpp/base/file_mojom_traits.cc",
"//mojo/public/cpp/base/file_mojom_traits.h",
] ]
type_mappings = type_mappings =
[ "mojo.common.mojom.File=base::File[move_only,nullable_is_same_type]" ] [ "mojo_base.mojom.File=base::File[move_only,nullable_is_same_type]" ]
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
mojom = "//mojo/common/file_info.mojom" mojom = "//mojo/public/mojom/base/file_info.mojom"
public_headers = [ "//base/files/file.h" ] public_headers = [ "//base/files/file.h" ]
traits_headers = [ "//ipc/ipc_message_utils.h" ] traits_headers = [ "//ipc/ipc_message_utils.h" ]
public_deps = [ public_deps = [
"//ipc", "//ipc",
] ]
type_mappings = [ "mojo.common.mojom.FileInfo=base::File::Info" ] type_mappings = [ "mojo_base.mojom.FileInfo=base::File::Info" ]
// Copyright 2018 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.
#include "mojo/public/cpp/base/file_mojom_traits.h"
#include "base/files/file.h"
#include "mojo/public/cpp/system/platform_handle.h"
namespace mojo {
mojo::ScopedHandle StructTraits<mojo_base::mojom::FileDataView, base::File>::fd(
base::File& file) {
DCHECK(file.IsValid());
return mojo::WrapPlatformFile(file.TakePlatformFile());
}
bool StructTraits<mojo_base::mojom::FileDataView, base::File>::Read(
mojo_base::mojom::FileDataView data,
base::File* file) {
base::PlatformFile platform_handle = base::kInvalidPlatformFile;
if (mojo::UnwrapPlatformFile(data.TakeFd(), &platform_handle) !=
MOJO_RESULT_OK) {
return false;
}
*file = base::File(platform_handle);
return true;
}
} // namespace mojo
// Copyright 2018 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.
#ifndef MOJO_PUBLIC_CPP_BASE_FILE_MOJOM_TRAITS_H_
#define MOJO_PUBLIC_CPP_BASE_FILE_MOJOM_TRAITS_H_
#include "base/component_export.h"
#include "base/files/file.h"
#include "mojo/public/mojom/base/file.mojom-shared.h"
namespace mojo {
template <>
struct COMPONENT_EXPORT(MOJO_BASE_MOJOM)
StructTraits<mojo_base::mojom::FileDataView, base::File> {
static bool IsNull(const base::File& file) { return !file.IsValid(); }
static void SetToNull(base::File* file) { *file = base::File(); }
static mojo::ScopedHandle fd(base::File& file);
static bool Read(mojo_base::mojom::FileDataView data, base::File* file);
};
} // namespace mojo
#endif // MOJO_PUBLIC_CPP_BASE_FILE_MOJOM_TRAITS_H_
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
mojom = "//mojo/common/file_path.mojom" mojom = "//mojo/public/mojom/base/file_path.mojom"
public_headers = [ "//base/files/file_path.h" ] public_headers = [ "//base/files/file_path.h" ]
traits_headers = [ "//ipc/ipc_message_utils.h" ] traits_headers = [ "//ipc/ipc_message_utils.h" ]
public_deps = [ public_deps = [
"//ipc", "//ipc",
] ]
type_mappings = [ "mojo.common.mojom.FilePath=base::FilePath" ] type_mappings = [ "mojo_base.mojom.FilePath=base::FilePath" ]
// Copyright 2018 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.
#include "ipc/ipc_message_utils.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "mojo/public/mojom/base/file_path.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo_base {
namespace file_path_unittest {
TEST(FilePathTest, File) {
base::FilePath dir(FILE_PATH_LITERAL("hello"));
base::FilePath file = dir.Append(FILE_PATH_LITERAL("world"));
base::FilePath file_out;
ASSERT_TRUE(
mojo::test::SerializeAndDeserialize<mojom::FilePath>(&file, &file_out));
ASSERT_EQ(file, file_out);
}
} // namespace file_path_unittest
} // namespace mojo_base
// Copyright 2018 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.
#include "base/files/scoped_temp_dir.h"
#include "mojo/public/cpp/base/file_mojom_traits.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "mojo/public/mojom/base/file.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo_base {
namespace file_unittest {
TEST(FileTest, File) {
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
base::File file(
temp_dir.GetPath().AppendASCII("test_file.txt"),
base::File::FLAG_CREATE | base::File::FLAG_WRITE | base::File::FLAG_READ);
const base::StringPiece test_content =
"A test string to be stored in a test file";
file.WriteAtCurrentPos(
test_content.data(),
base::checked_cast<int>(test_content.size()));
base::File file_out;
ASSERT_TRUE(
mojo::test::SerializeAndDeserialize<mojom::File>(&file, &file_out));
std::vector<char> content(test_content.size());
ASSERT_TRUE(file_out.IsValid());
ASSERT_EQ(static_cast<int>(test_content.size()),
file_out.Read(
0, content.data(),
base::checked_cast<int>(test_content.size())));
EXPECT_EQ(test_content,
base::StringPiece(content.data(), test_content.size()));
}
TEST(FileTest, InvalidFile) {
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
// Test that |file_out| is set to an invalid file.
base::File file_out(
temp_dir.GetPath().AppendASCII("test_file.txt"),
base::File::FLAG_CREATE | base::File::FLAG_WRITE | base::File::FLAG_READ);
base::File file = base::File();
ASSERT_TRUE(
mojo::test::SerializeAndDeserialize<mojom::File>(&file, &file_out));
EXPECT_FALSE(file_out.IsValid());
}
} // namespace file_unittest
} // namespace mojo_base
...@@ -8,4 +8,7 @@ typemaps = [ ...@@ -8,4 +8,7 @@ typemaps = [
"//mojo/public/cpp/base/file_error.typemap", "//mojo/public/cpp/base/file_error.typemap",
"//mojo/public/cpp/base/ref_counted_memory.typemap", "//mojo/public/cpp/base/ref_counted_memory.typemap",
"//mojo/public/cpp/base/string16.typemap", "//mojo/public/cpp/base/string16.typemap",
"//mojo/public/cpp/base/file.typemap",
"//mojo/public/cpp/base/file_info.typemap",
"//mojo/public/cpp/base/file_path.typemap",
] ]
...@@ -8,7 +8,10 @@ mojom_component("base") { ...@@ -8,7 +8,10 @@ mojom_component("base") {
sources = [ sources = [
"big_buffer.mojom", "big_buffer.mojom",
"big_string.mojom", "big_string.mojom",
"file.mojom",
"file_error.mojom", "file_error.mojom",
"file_info.mojom",
"file_path.mojom",
"ref_counted_memory.mojom", "ref_counted_memory.mojom",
"string16.mojom", "string16.mojom",
] ]
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
module mojo.common.mojom; module mojo_base.mojom;
// Corresponds to |base::File| in base/files/file.h // Corresponds to |base::File| in base/files/file.h
struct File { struct File {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
module mojo.common.mojom; module mojo_base.mojom;
[Native] [Native]
struct FileInfo; struct FileInfo;
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
module mojo.common.mojom; module mojo_base.mojom;
[Native] [Native]
struct FilePath; struct FilePath;
...@@ -16,6 +16,7 @@ mojom("mojom") { ...@@ -16,6 +16,7 @@ mojom("mojom") {
":constants", ":constants",
"//media/mojo/interfaces", "//media/mojo/interfaces",
"//mojo/common:common_custom_types", "//mojo/common:common_custom_types",
"//mojo/public/mojom/base",
] ]
} }
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
module audio.mojom; module audio.mojom;
import "mojo/common/file.mojom"; import "mojo/public/mojom/base/file.mojom";
import "mojo/common/file_path.mojom"; import "mojo/public/mojom/base/file_path.mojom";
enum DebugRecordingStreamType { enum DebugRecordingStreamType {
kInput = 0, kInput = 0,
...@@ -22,7 +22,7 @@ enum DebugRecordingStreamType { ...@@ -22,7 +22,7 @@ enum DebugRecordingStreamType {
interface DebugRecordingFileProvider { interface DebugRecordingFileProvider {
// Returns invalid file in case of failure. // Returns invalid file in case of failure.
CreateWavFile(DebugRecordingStreamType stream_type, uint32 id) CreateWavFile(DebugRecordingStreamType stream_type, uint32 id)
=> (mojo.common.mojom.File? file); => (mojo_base.mojom.File? file);
}; };
// Controls audio debug recording. To enable, bind interface and call Enable // Controls audio debug recording. To enable, bind interface and call Enable
......
...@@ -11,7 +11,7 @@ mojom("mojom") { ...@@ -11,7 +11,7 @@ mojom("mojom") {
public_deps = [ public_deps = [
":constants", ":constants",
"//mojo/common:common_custom_types", "//mojo/public/mojom/base",
] ]
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
module catalog.mojom; module catalog.mojom;
import "mojo/common/file_path.mojom"; import "mojo/public/mojom/base/file_path.mojom";
struct Entry { struct Entry {
string name; string name;
......
...@@ -79,6 +79,7 @@ mojom("mojom") { ...@@ -79,6 +79,7 @@ mojom("mojom") {
":mutable_network_traffic_annotation_interface", ":mutable_network_traffic_annotation_interface",
":udp_socket_interface", ":udp_socket_interface",
"//mojo/common:common_custom_types", "//mojo/common:common_custom_types",
"//mojo/public/mojom/base",
"//net/interfaces", "//net/interfaces",
"//services/proxy_resolver/public/mojom", "//services/proxy_resolver/public/mojom",
"//url/mojom:url_mojom_gurl", "//url/mojom:url_mojom_gurl",
......
...@@ -4,18 +4,19 @@ ...@@ -4,18 +4,19 @@
module network.mojom; module network.mojom;
import "mojo/common/file_path.mojom";
import "mojo/common/time.mojom"; import "mojo/common/time.mojom";
import "mojo/public/mojom/base/file_path.mojom";
import "net/interfaces/address_list.mojom";
import "net/interfaces/ip_endpoint.mojom"; import "net/interfaces/ip_endpoint.mojom";
import "services/network/public/mojom/cookie_manager.mojom"; import "services/network/public/mojom/cookie_manager.mojom";
import "services/network/public/mojom/network_change_manager.mojom"; import "services/network/public/mojom/network_change_manager.mojom";
import "services/network/public/mojom/proxy_config.mojom"; import "services/network/public/mojom/proxy_config.mojom";
import "services/network/public/mojom/proxy_config_with_annotation.mojom"; import "services/network/public/mojom/proxy_config_with_annotation.mojom";
import "services/network/public/mojom/restricted_cookie_manager.mojom";
import "services/network/public/mojom/udp_socket.mojom"; import "services/network/public/mojom/udp_socket.mojom";
import "services/network/public/mojom/url_loader.mojom"; import "services/network/public/mojom/url_loader.mojom";
import "services/network/public/mojom/url_loader_factory.mojom"; import "services/network/public/mojom/url_loader_factory.mojom";
import "services/proxy_resolver/public/mojom/proxy_resolver.mojom"; import "services/proxy_resolver/public/mojom/proxy_resolver.mojom";
import "services/network/public/mojom/restricted_cookie_manager.mojom";
import "url/mojom/origin.mojom"; import "url/mojom/origin.mojom";
import "url/mojom/url.mojom"; import "url/mojom/url.mojom";
...@@ -45,7 +46,7 @@ struct NetworkContextParams { ...@@ -45,7 +46,7 @@ struct NetworkContextParams {
proxy_resolver.mojom.ProxyResolverFactory? proxy_resolver_factory; proxy_resolver.mojom.ProxyResolverFactory? proxy_resolver_factory;
// Points to the cookie file. An in-memory cookie store is used if it's empty. // Points to the cookie file. An in-memory cookie store is used if it's empty.
mojo.common.mojom.FilePath? cookie_path; mojo_base.mojom.FilePath? cookie_path;
// If the cookie file is given, this controls whether previously written // If the cookie file is given, this controls whether previously written
// session cookies are restored. Otherwise it should be false. // session cookies are restored. Otherwise it should be false.
...@@ -57,7 +58,7 @@ struct NetworkContextParams { ...@@ -57,7 +58,7 @@ struct NetworkContextParams {
// Points to the channel ID file. If a cookie file is specified, this must be // Points to the channel ID file. If a cookie file is specified, this must be
// specifed as well. Otherwise an in-memory store is used. // specifed as well. Otherwise an in-memory store is used.
mojo.common.mojom.FilePath? channel_id_path; mojo_base.mojom.FilePath? channel_id_path;
// True if an HTTP cache should be used. // True if an HTTP cache should be used.
bool http_cache_enabled = true; bool http_cache_enabled = true;
...@@ -66,12 +67,12 @@ struct NetworkContextParams { ...@@ -66,12 +67,12 @@ struct NetworkContextParams {
int32 http_cache_max_size = 0; int32 http_cache_max_size = 0;
// Points to the HTTP cache directory. Ignored if the cache is disabled. // Points to the HTTP cache directory. Ignored if the cache is disabled.
// If null and the cache is enabled, an in-memory database is used. // If null and the cache is enabled, an in-memory database is used.
mojo.common.mojom.FilePath? http_cache_path; mojo_base.mojom.FilePath? http_cache_path;
// The file to store cached server properties (Like HTTP2 and QUIC support). // The file to store cached server properties (Like HTTP2 and QUIC support).
// This information is used as a performance optimization in connection // This information is used as a performance optimization in connection
// logic. If null, an in-memory cache will be used instead. // logic. If null, an in-memory cache will be used instead.
mojo.common.mojom.FilePath? http_server_properties_path; mojo_base.mojom.FilePath? http_server_properties_path;
// Enabled protocols. Note that these apply to all fetches, including those // Enabled protocols. Note that these apply to all fetches, including those
// used to fetch PAC scripts. // used to fetch PAC scripts.
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
module prefs.mojom; module prefs.mojom;
import "mojo/common/file_path.mojom";
import "mojo/public/mojom/base/string16.mojom";
import "mojo/common/values.mojom"; import "mojo/common/values.mojom";
import "mojo/public/mojom/base/file_path.mojom";
import "mojo/public/mojom/base/string16.mojom";
import "services/preferences/public/mojom/tracked_preference_validation_delegate.mojom"; import "services/preferences/public/mojom/tracked_preference_validation_delegate.mojom";
const string kServiceName = "preferences"; const string kServiceName = "preferences";
...@@ -176,8 +176,8 @@ struct PrefRegistration { ...@@ -176,8 +176,8 @@ struct PrefRegistration {
// These parameters are passed to prefs::CreateTrackedPersistentPrefStore() in // These parameters are passed to prefs::CreateTrackedPersistentPrefStore() in
// services/preferences/persistent_pref_store_factory.cc. // services/preferences/persistent_pref_store_factory.cc.
struct TrackedPersistentPrefStoreConfiguration { struct TrackedPersistentPrefStoreConfiguration {
mojo.common.mojom.FilePath unprotected_pref_filename; mojo_base.mojom.FilePath unprotected_pref_filename;
mojo.common.mojom.FilePath protected_pref_filename; mojo_base.mojom.FilePath protected_pref_filename;
array<TrackedPreferenceMetadata> tracking_configuration; array<TrackedPreferenceMetadata> tracking_configuration;
uint64 reporting_ids_count; uint64 reporting_ids_count;
string seed; string seed;
......
...@@ -19,7 +19,10 @@ mojom("input_devices") { ...@@ -19,7 +19,10 @@ mojom("input_devices") {
public_deps += [ "//ui/events/devices/mojo" ] public_deps += [ "//ui/events/devices/mojo" ]
if (use_ozone) { if (use_ozone) {
sources += [ "input_device_controller.mojom" ] sources += [ "input_device_controller.mojom" ]
public_deps += [ "//mojo/common:common_custom_types" ] public_deps += [
"//mojo/common:common_custom_types",
"//mojo/public/mojom/base",
]
} }
} }
} }
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
module ui.mojom; module ui.mojom;
import "mojo/common/file_path.mojom";
import "mojo/common/time.mojom"; import "mojo/common/time.mojom";
import "mojo/public/mojom/base/file_path.mojom";
import "ui/events/devices/mojo/input_devices.mojom"; import "ui/events/devices/mojo/input_devices.mojom";
struct KeyboardDeviceState { struct KeyboardDeviceState {
...@@ -49,8 +49,8 @@ interface InputDeviceController { ...@@ -49,8 +49,8 @@ interface InputDeviceController {
// Touchscreen log settings. // Touchscreen log settings.
GetTouchDeviceStatus() => (string status); GetTouchDeviceStatus() => (string status);
GetTouchEventLog(mojo.common.mojom.FilePath out_dir) => GetTouchEventLog(mojo_base.mojom.FilePath out_dir) =>
(array<mojo.common.mojom.FilePath> results); (array<mojo_base.mojom.FilePath> results);
// Temporarily enable/disable Tap-to-click. Used to enhance the user // Temporarily enable/disable Tap-to-click. Used to enhance the user
// experience in some use cases (e.g., typing, watching video). // experience in some use cases (e.g., typing, watching video).
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
mojom = "//mojo/common/file.mojom" mojom = "//mojo/public/mojom/base/file.mojom"
public_headers = [ "//base/files/file.h" ] public_headers = [ "//base/files/file.h" ]
traits_headers = [ "//mojo/common/common_custom_types_struct_traits.h" ] traits_headers = [ "//mojo/public/cpp/base/file_mojom_traits.h" ]
deps = [ deps = [
"//mojo/common:struct_traits", "//mojo/public/mojom/base",
] ]
type_mappings = type_mappings =
[ "mojo.common.mojom.File=base::File[move_only,nullable_is_same_type]" ] [ "mojo_base.mojom.File=base::File[move_only,nullable_is_same_type]" ]
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# found in the LICENSE file. # found in the LICENSE file.
typemaps = [ typemaps = [
"//mojo/common/file_path.typemap", "//mojo/public/cpp/base/file_path.typemap",
"//mojo/common/values.typemap", "//mojo/common/values.typemap",
"//third_party/WebKit/Source/core/messaging/BlinkCloneableMessage.typemap", "//third_party/WebKit/Source/core/messaging/BlinkCloneableMessage.typemap",
"//third_party/WebKit/Source/core/messaging/BlinkTransferableMessage.typemap", "//third_party/WebKit/Source/core/messaging/BlinkTransferableMessage.typemap",
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
module blink.mojom; module blink.mojom;
import "mojo/common/file.mojom";
import "mojo/common/file_path.mojom";
import "mojo/common/time.mojom"; import "mojo/common/time.mojom";
import "mojo/public/mojom/base/file.mojom";
import "mojo/public/mojom/base/file_path.mojom";
import "third_party/WebKit/public/mojom/blob/blob.mojom"; import "third_party/WebKit/public/mojom/blob/blob.mojom";
import "url/mojom/origin.mojom"; import "url/mojom/origin.mojom";
import "url/mojom/url.mojom"; import "url/mojom/url.mojom";
...@@ -66,14 +66,14 @@ interface BytesProvider { ...@@ -66,14 +66,14 @@ interface BytesProvider {
// If writing for whatever reason fails, the callback is called without a // If writing for whatever reason fails, the callback is called without a
// modification time. // modification time.
RequestAsFile(uint64 source_offset, uint64 source_size, RequestAsFile(uint64 source_offset, uint64 source_size,
mojo.common.mojom.File file, uint64 file_offset) mojo_base.mojom.File file, uint64 file_offset)
=> (mojo.common.mojom.Time? time_file_modified); => (mojo.common.mojom.Time? time_file_modified);
}; };
// A reference to a slice of a file on disk. // A reference to a slice of a file on disk.
struct DataElementFile { struct DataElementFile {
// Path of the file. // Path of the file.
mojo.common.mojom.FilePath path; mojo_base.mojom.FilePath path;
// Offset inside the file. // Offset inside the file.
uint64 offset; uint64 offset;
// Length of the slice. Can be uint64_max if the length is unknown. If this is // Length of the slice. Can be uint64_max if the length is unknown. If this is
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
module blink.mojom; module blink.mojom;
import "mojo/common/file.mojom"; import "mojo/public/mojom/base/file.mojom";
// Loads hyphenation dictionary. // Loads hyphenation dictionary.
interface Hyphenation { interface Hyphenation {
// Returns a handle to the raw hyphneation dictionary. // Returns a handle to the raw hyphneation dictionary.
[Sync] [Sync]
OpenDictionary(string locale) => ( OpenDictionary(string locale) => (
mojo.common.mojom.File? hyphenation_dictionary_handle); mojo_base.mojom.File? hyphenation_dictionary_handle);
}; };
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
module blink.mojom; module blink.mojom;
import "mojo/common/file.mojom"; import "mojo/public/mojom/base/file.mojom";
import "mojo/public/mojom/base/string16.mojom"; import "mojo/public/mojom/base/string16.mojom";
import "url/mojom/origin.mojom"; import "url/mojom/origin.mojom";
...@@ -23,7 +23,7 @@ interface WebDatabaseHost { ...@@ -23,7 +23,7 @@ interface WebDatabaseHost {
// Asks the browser process to open a DB file with the given name. // Asks the browser process to open a DB file with the given name.
[Sync] [Sync]
OpenFile(mojo_base.mojom.String16 vfs_file_name, OpenFile(mojo_base.mojom.String16 vfs_file_name,
int32 desired_flags) => (mojo.common.mojom.File? file); int32 desired_flags) => (mojo_base.mojom.File? file);
// Asks the browser process to delete a DB file. // Asks the browser process to delete a DB file.
[Sync] [Sync]
......
...@@ -17,7 +17,7 @@ mojom("interfaces") { ...@@ -17,7 +17,7 @@ mojom("interfaces") {
] ]
public_deps = [ public_deps = [
"//mojo/common:common_custom_types", "//mojo/public/mojom/base",
"//ui/gfx/geometry/mojo", "//ui/gfx/geometry/mojo",
"//ui/gfx/mojo", "//ui/gfx/mojo",
] ]
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
module display.mojom; module display.mojom;
import "mojo/common/file_path.mojom"; import "mojo/public/mojom/base/file_path.mojom";
import "ui/display/mojo/display_constants.mojom"; import "ui/display/mojo/display_constants.mojom";
import "ui/display/mojo/display_mode.mojom"; import "ui/display/mojo/display_mode.mojom";
import "ui/gfx/geometry/mojo/geometry.mojom"; import "ui/gfx/geometry/mojo/geometry.mojom";
...@@ -21,7 +21,7 @@ struct DisplaySnapshot { ...@@ -21,7 +21,7 @@ struct DisplaySnapshot {
bool has_color_correction_matrix; bool has_color_correction_matrix;
gfx.mojom.ColorSpace color_space; gfx.mojom.ColorSpace color_space;
string display_name; string display_name;
mojo.common.mojom.FilePath sys_path; mojo_base.mojom.FilePath sys_path;
array<display.mojom.DisplayMode> modes; array<display.mojom.DisplayMode> modes;
array<uint8> edid; array<uint8> edid;
uint64 current_mode_index; uint64 current_mode_index;
......
...@@ -12,7 +12,7 @@ mojom("interfaces") { ...@@ -12,7 +12,7 @@ mojom("interfaces") {
] ]
public_deps = [ public_deps = [
"//mojo/common:common_custom_types", "//mojo/public/mojom/base",
"//skia/public/interfaces:interfaces", "//skia/public/interfaces:interfaces",
"//ui/display/mojo:interfaces", "//ui/display/mojo:interfaces",
"//ui/gfx/geometry/mojo", "//ui/gfx/geometry/mojo",
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
module ui.ozone.mojom; module ui.ozone.mojom;
import "mojo/common/file.mojom"; import "mojo/public/mojom/base/file.mojom";
import "mojo/common/file_path.mojom"; import "mojo/public/mojom/base/file_path.mojom";
import "ui/display/mojo/display_constants.mojom"; import "ui/display/mojo/display_constants.mojom";
import "ui/display/mojo/display_mode.mojom"; import "ui/display/mojo/display_mode.mojom";
import "ui/display/mojo/display_snapshot.mojom"; import "ui/display/mojo/display_snapshot.mojom";
...@@ -46,11 +46,11 @@ interface DrmDevice { ...@@ -46,11 +46,11 @@ interface DrmDevice {
(array<display.mojom.DisplaySnapshot> display_snapshots); (array<display.mojom.DisplaySnapshot> display_snapshots);
// Transfers ownership of a DRM device to the GPU process. // Transfers ownership of a DRM device to the GPU process.
AddGraphicsDevice(mojo.common.mojom.FilePath path, AddGraphicsDevice(mojo_base.mojom.FilePath path,
mojo.common.mojom.File file); mojo_base.mojom.File file);
// Instructs the GPU to abandon a DRM device. // Instructs the GPU to abandon a DRM device.
RemoveGraphicsDevice(mojo.common.mojom.FilePath path); RemoveGraphicsDevice(mojo_base.mojom.FilePath path);
// Instructs the GPU to disable a DRM device. // Instructs the GPU to disable a DRM device.
DisableNativeDisplay(int64 display_id) => (int64 display_id, bool success); DisableNativeDisplay(int64 display_id) => (int64 display_id, bool success);
......
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