diff options
85 files changed, 334 insertions, 399 deletions
diff --git a/content/common/geolocation_service.mojom b/content/common/geolocation_service.mojom index 923cb76..00d5640 100644 --- a/content/common/geolocation_service.mojom +++ b/content/common/geolocation_service.mojom @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import "content/public/common/mojo_geoposition.mojom"; +module content; -module content { +import "content/public/common/mojo_geoposition.mojom"; // The Geolocation service provides updates on the device's location to its // client. By default, it provides updates with low accuracy, but @@ -17,5 +17,3 @@ interface GeolocationService { interface GeolocationServiceClient { OnLocationUpdate(MojoGeoposition geoposition); }; - -} diff --git a/content/common/render_frame_setup.mojom b/content/common/render_frame_setup.mojom index 92d6033..0a1d433 100644 --- a/content/common/render_frame_setup.mojom +++ b/content/common/render_frame_setup.mojom @@ -2,13 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import "mojo/public/interfaces/application/service_provider.mojom"; +module content; -module content { +import "mojo/public/interfaces/application/service_provider.mojom"; interface RenderFrameSetup { GetServiceProviderForFrame(int32 frame_routing_id, mojo.ServiceProvider& service_provider); }; - -} diff --git a/content/public/common/mojo_geoposition.mojom b/content/public/common/mojo_geoposition.mojom index f9818b5..852f2a9 100644 --- a/content/public/common/mojo_geoposition.mojom +++ b/content/public/common/mojo_geoposition.mojom @@ -8,7 +8,7 @@ // TODO(blundell): Investigate killing content::Geoposition in favor of using // this struct everywhere (and renaming it to Geoposition). -module content { +module content; struct MojoGeoposition { // These values follow the W3C geolocation specification and can be returned @@ -54,5 +54,3 @@ struct MojoGeoposition { // Human-readable error message. string error_message; }; - -} diff --git a/content/test/data/web_ui_test_mojo_bindings.mojom b/content/test/data/web_ui_test_mojo_bindings.mojom index 45f291f..76a5c0d 100644 --- a/content/test/data/web_ui_test_mojo_bindings.mojom +++ b/content/test/data/web_ui_test_mojo_bindings.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module content { +module content; [Client=RendererTarget] interface BrowserTarget { @@ -12,5 +12,3 @@ interface BrowserTarget { interface RendererTarget { Ping(); }; - -} diff --git a/device/battery/battery_monitor.mojom b/device/battery/battery_monitor.mojom index fa29591..880685e 100644 --- a/device/battery/battery_monitor.mojom +++ b/device/battery/battery_monitor.mojom @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import "device/battery/battery_status.mojom"; +module device; -module device { +import "device/battery/battery_status.mojom"; // A BatteryMonitor will periodically call its client's DidChange method. [Client=BatteryStatusObserver] @@ -14,5 +14,3 @@ interface BatteryMonitor { interface BatteryStatusObserver { DidChange(BatteryStatus status); }; - -} diff --git a/device/battery/battery_status.mojom b/device/battery/battery_status.mojom index 6e9ba46..f89808c 100644 --- a/device/battery/battery_status.mojom +++ b/device/battery/battery_status.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module device { +module device; struct BatteryStatus { bool charging = true; @@ -10,5 +10,3 @@ struct BatteryStatus { double discharging_time = double.INFINITY; double level = 1.0; }; - -} diff --git a/device/serial/data_stream.mojom b/device/serial/data_stream.mojom index 8968d7a..a288eb2 100644 --- a/device/serial/data_stream.mojom +++ b/device/serial/data_stream.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module device.serial { +module device.serial; [Client=DataSourceClient] interface DataSource { @@ -51,5 +51,3 @@ interface DataSinkClient { // when it is ready to resume sending data. ReportBytesSentAndError(uint32 bytes_sent, int32 error) => (); }; - -} diff --git a/device/serial/data_stream_serialization.mojom b/device/serial/data_stream_serialization.mojom index b38e8ab..259be28 100644 --- a/device/serial/data_stream_serialization.mojom +++ b/device/serial/data_stream_serialization.mojom @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import "data_stream.mojom"; +module device.serial; -module device.serial { +import "data_stream.mojom"; // A serialized form of a DataSender. struct SerializedDataSender { @@ -48,5 +48,3 @@ struct SerializedDataReceiver { array<array<uint8>> pending_data; }; - -} diff --git a/device/serial/serial.mojom b/device/serial/serial.mojom index d694203..6714a94 100644 --- a/device/serial/serial.mojom +++ b/device/serial/serial.mojom @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import "data_stream.mojom"; +module device.serial; -module device.serial { +import "data_stream.mojom"; struct DeviceInfo { string path; @@ -104,5 +104,3 @@ interface Connection { GetControlSignals() => (DeviceControlSignals? signals); Flush() => (bool success); }; - -} diff --git a/device/serial/serial_serialization.mojom b/device/serial/serial_serialization.mojom index 4217875..08c2356 100644 --- a/device/serial/serial_serialization.mojom +++ b/device/serial/serial_serialization.mojom @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +module device.serial; + import "serial.mojom"; import "data_stream_serialization.mojom"; -module device.serial { - // The client state of a serial connection. struct ConnectionState { uint32 connectionId; @@ -27,5 +27,3 @@ struct SerializedConnection { SerializedDataSender sender; SerializedDataReceiver receiver; }; - -} diff --git a/extensions/common/mojo/keep_alive.mojom b/extensions/common/mojo/keep_alive.mojom index 75b08b4..9f36ae6 100644 --- a/extensions/common/mojo/keep_alive.mojom +++ b/extensions/common/mojo/keep_alive.mojom @@ -2,11 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module extensions { +module extensions; // An RAII service for keep alives. While KeepAlive services for an extension // remain, the background page for that extension will remain alive. interface KeepAlive { }; - -} diff --git a/extensions/common/mojo/stash.mojom b/extensions/common/mojo/stash.mojom index 734697b..6cc4908 100644 --- a/extensions/common/mojo/stash.mojom +++ b/extensions/common/mojo/stash.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module extensions { +module extensions; // A stashed client object. This contains the serialized bytes and handles, // stored in |data| and |handles|, respectively, of a mojo struct of the @@ -28,5 +28,3 @@ interface StashService { // Returns all stashed objects. RetrieveStash() => (array<StashedObject> stash); }; - -} diff --git a/ipc/mojo/client_channel.mojom b/ipc/mojo/client_channel.mojom index b2da0d4..fd909d4 100644 --- a/ipc/mojo/client_channel.mojom +++ b/ipc/mojo/client_channel.mojom @@ -2,10 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module IPC { +module IPC; interface ClientChannel { Init(handle<message_pipe> pipe, int32 peer_pid) => (int32 pid); }; - -} diff --git a/media/mojo/interfaces/demuxer_stream.mojom b/media/mojo/interfaces/demuxer_stream.mojom index 2ce43e6..a43f9d8 100644 --- a/media/mojo/interfaces/demuxer_stream.mojom +++ b/media/mojo/interfaces/demuxer_stream.mojom @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import "media/mojo/interfaces/media_types.mojom"; +module mojo; -module mojo { +import "media/mojo/interfaces/media_types.mojom"; // DemuxerStream is modeled after media::DemuxerStream using mojo in order to // enable proxying between a media::Pipeline and media::Renderer living in two @@ -50,5 +50,3 @@ interface DemuxerStreamClient { // in a Read() callback or over the DataPipe). OnAudioDecoderConfigChanged(AudioDecoderConfig config); }; - -} // module mojo diff --git a/media/mojo/interfaces/media_renderer.mojom b/media/mojo/interfaces/media_renderer.mojom index 6a1e5bc..db7adc8 100644 --- a/media/mojo/interfaces/media_renderer.mojom +++ b/media/mojo/interfaces/media_renderer.mojom @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +module mojo; + import "media/mojo/interfaces/demuxer_stream.mojom"; import "media/mojo/interfaces/media_types.mojom"; -module mojo { - [Client=MediaRendererClient] interface MediaRenderer { // Initializes the Renderer with |stream|, calling back upon completion. @@ -49,5 +49,3 @@ interface MediaRendererClient { // OnError() will be called before firing the completion callback. OnError(); }; - -} // module mojo diff --git a/media/mojo/interfaces/media_types.mojom b/media/mojo/interfaces/media_types.mojom index edaf282..a8a85c9 100644 --- a/media/mojo/interfaces/media_types.mojom +++ b/media/mojo/interfaces/media_types.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo { +module mojo; // See media/base/buffering_state.h for descriptions. // Kept in sync with media::BufferingState via COMPILE_ASSERTs. @@ -123,5 +123,3 @@ struct MediaDecoderBuffer { // for now for prototyping audio. handle<data_pipe_consumer>? data; }; - -} // module mojo diff --git a/mojo/application_manager/test.mojom b/mojo/application_manager/test.mojom index 6a03581..d091abf 100644 --- a/mojo/application_manager/test.mojom +++ b/mojo/application_manager/test.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo { +module mojo; [Client=TestClient] interface TestService { @@ -26,5 +26,3 @@ interface TestB { interface TestC { C() => (); }; - -} diff --git a/mojo/public/BUILD.gn b/mojo/public/BUILD.gn index b661383..89fab8d 100644 --- a/mojo/public/BUILD.gn +++ b/mojo/public/BUILD.gn @@ -13,7 +13,7 @@ group("public") { "//mojo/public/cpp/environment:standalone", "//mojo/public/cpp/utility", "//mojo/public/interfaces/bindings/tests:test_interfaces", - "//mojo/public/html", + "//mojo/public/sky", ] if (is_linux) { diff --git a/mojo/public/VERSION b/mojo/public/VERSION index ed199b2..b711f1d 100644 --- a/mojo/public/VERSION +++ b/mojo/public/VERSION @@ -1 +1 @@ -91d94d6993c9b0c4135a95687a7d541ce90629b7
\ No newline at end of file +cfc99316100efdfa7d53d83f9e07f1d4d3765c21
\ No newline at end of file diff --git a/mojo/public/c/system/tests/BUILD.gn b/mojo/public/c/system/tests/BUILD.gn index 02b591a..67e166d 100644 --- a/mojo/public/c/system/tests/BUILD.gn +++ b/mojo/public/c/system/tests/BUILD.gn @@ -20,8 +20,7 @@ source_set("tests") { } # GYP version: mojo/mojo_base.gyp:mojo_public_system_perftests -executable("perftests") { - testonly = true +test("perftests") { output_name = "mojo_public_system_perftests" sources = [ diff --git a/mojo/public/cpp/application/BUILD.gn b/mojo/public/cpp/application/BUILD.gn index 83dc136..1eacdc6 100644 --- a/mojo/public/cpp/application/BUILD.gn +++ b/mojo/public/cpp/application/BUILD.gn @@ -48,6 +48,11 @@ source_set("standalone") { source_set("test_support") { testonly = true + sources = [ + "application_test_base.h", + "lib/application_test_base.cc", + ] + deps = [ ":application", "//mojo/public/cpp/bindings", @@ -55,10 +60,15 @@ source_set("test_support") { "//mojo/public/cpp/system", "//testing/gtest", ] +} - sources = [ - "application_test_base.h", - "lib/application_test_base.cc", - "lib/application_test_main.cc", +source_set("test_support_standalone") { + testonly = true + sources = [ "lib/application_test_main.cc", ] + public_deps = [ ":test_support", ] + deps = [ + "//mojo/public/cpp/environment:standalone", + "//mojo/public/cpp/application", + "//mojo/public/cpp/system", ] } diff --git a/mojo/public/cpp/application/application_delegate.h b/mojo/public/cpp/application/application_delegate.h index cb67308..b0f2916 100644 --- a/mojo/public/cpp/application/application_delegate.h +++ b/mojo/public/cpp/application/application_delegate.h @@ -19,10 +19,6 @@ class ApplicationDelegate { ApplicationDelegate(); virtual ~ApplicationDelegate(); - // Implement this method to create the specific subclass of - // ApplicationDelegate. Ownership is taken by the caller. It will be deleted. - static ApplicationDelegate* Create(); - virtual void Initialize(ApplicationImpl* app); // Override this method to configure what services a connection supports when diff --git a/mojo/public/cpp/application/lib/application_test_main.cc b/mojo/public/cpp/application/lib/application_test_main.cc index be4e54e..61e3ea3 100644 --- a/mojo/public/cpp/application/lib/application_test_main.cc +++ b/mojo/public/cpp/application/lib/application_test_main.cc @@ -10,6 +10,7 @@ #include "mojo/public/cpp/system/message_pipe.h" MojoResult MojoMain(MojoHandle shell_handle) { + // An Environment instance is needed to construct run loops. mojo::Environment environment; { diff --git a/mojo/public/interfaces/application/application.mojom b/mojo/public/interfaces/application/application.mojom index 67e14d7..4cf2110 100644 --- a/mojo/public/interfaces/application/application.mojom +++ b/mojo/public/interfaces/application/application.mojom @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import "mojo/public/interfaces/application/service_provider.mojom"; +module mojo; -module mojo { +import "mojo/public/interfaces/application/service_provider.mojom"; // Applications vend Services through the ServiceProvider interface. Services // implement Interfaces. @@ -14,5 +14,3 @@ interface Application { AcceptConnection(string? requestor_url, ServiceProvider? provider); }; - -} diff --git a/mojo/public/interfaces/application/service_provider.mojom b/mojo/public/interfaces/application/service_provider.mojom index 00eb057..fe0100b 100644 --- a/mojo/public/interfaces/application/service_provider.mojom +++ b/mojo/public/interfaces/application/service_provider.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo { +module mojo; // ServiceProvider is used to establish connections to services in a bi- // directional fashion between two applications. @@ -12,5 +12,3 @@ interface ServiceProvider { // service does not exist, then the handle will be closed. ConnectToService(string? interface_name, handle<message_pipe>? pipe); }; - -} diff --git a/mojo/public/interfaces/application/shell.mojom b/mojo/public/interfaces/application/shell.mojom index 72e1764..3cc90fc 100644 --- a/mojo/public/interfaces/application/shell.mojom +++ b/mojo/public/interfaces/application/shell.mojom @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +module mojo; + import "mojo/public/interfaces/application/application.mojom"; import "mojo/public/interfaces/application/service_provider.mojom"; -module mojo { - // The Shell is the finder and launcher of Applications. An Application uses // it's Shell interface to connect to other Applications. [Client=Application] @@ -15,5 +15,3 @@ interface Shell { // --origin flag to the shell being used. ConnectToApplication(string? application_url, ServiceProvider&? provider); }; - -} diff --git a/mojo/public/interfaces/bindings/tests/math_calculator.mojom b/mojo/public/interfaces/bindings/tests/math_calculator.mojom index a18add1..f99bb07 100644 --- a/mojo/public/interfaces/bindings/tests/math_calculator.mojom +++ b/mojo/public/interfaces/bindings/tests/math_calculator.mojom @@ -3,7 +3,7 @@ // found in the LICENSE file. [JavaPackage="org.chromium.mojo.bindings.test.mojom.math"] -module math { +module math; [Client=CalculatorUI] interface Calculator { @@ -15,5 +15,3 @@ interface Calculator { interface CalculatorUI { Output@0(double value@0); }; - -} diff --git a/mojo/public/interfaces/bindings/tests/rect.mojom b/mojo/public/interfaces/bindings/tests/rect.mojom index 324ce48..b8cc977 100644 --- a/mojo/public/interfaces/bindings/tests/rect.mojom +++ b/mojo/public/interfaces/bindings/tests/rect.mojom @@ -3,7 +3,7 @@ // found in the LICENSE file. [JavaPackage="org.chromium.mojo.bindings.test.mojom.test_structs"] -module mojo.test { +module mojo.test; struct Rect { int32 x; @@ -11,5 +11,3 @@ struct Rect { int32 width; int32 height; }; - -} diff --git a/mojo/public/interfaces/bindings/tests/regression_tests.mojom b/mojo/public/interfaces/bindings/tests/regression_tests.mojom index 3baf77e..313f1f4 100644 --- a/mojo/public/interfaces/bindings/tests/regression_tests.mojom +++ b/mojo/public/interfaces/bindings/tests/regression_tests.mojom @@ -5,7 +5,7 @@ // Module containing entities for regression tests of the generator. Entities // must never be modified, instead new entity must be added to add new tests. [JavaPackage="org.chromium.mojo.bindings.test.mojom.regression_tests"] -module regression_tests { +module regression_tests; interface CheckMethodWithEmptyResponse { WithouParameterAndEmptyResponse() => (); @@ -52,5 +52,3 @@ struct A { struct B { A? a; }; - -} // module imported diff --git a/mojo/public/interfaces/bindings/tests/sample_factory.mojom b/mojo/public/interfaces/bindings/tests/sample_factory.mojom index b818921..eb5d930 100644 --- a/mojo/public/interfaces/bindings/tests/sample_factory.mojom +++ b/mojo/public/interfaces/bindings/tests/sample_factory.mojom @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import "sample_import.mojom"; - [JavaPackage="org.chromium.mojo.bindings.test.mojom.sample"] -module sample { +module sample; + +import "sample_import.mojom"; // This sample shows how handles to MessagePipes can be sent as both parameters // to methods as well as fields on structs. @@ -44,5 +44,3 @@ interface FactoryClient { DidStuff(Response response, string text); DidStuff2(string text); }; - -} // module sample diff --git a/mojo/public/interfaces/bindings/tests/sample_import.mojom b/mojo/public/interfaces/bindings/tests/sample_import.mojom index 659b74d..d28cb7b 100644 --- a/mojo/public/interfaces/bindings/tests/sample_import.mojom +++ b/mojo/public/interfaces/bindings/tests/sample_import.mojom @@ -3,7 +3,7 @@ // found in the LICENSE file. [JavaPackage="org.chromium.mojo.bindings.test.mojom.imported"] -module imported { +module imported; // This sample just defines some types that are imported into // sample_service.mojom, to show how import works. @@ -36,5 +36,3 @@ struct Point { interface ImportedInterface { DoSomething(); }; - -} // module imported diff --git a/mojo/public/interfaces/bindings/tests/sample_import2.mojom b/mojo/public/interfaces/bindings/tests/sample_import2.mojom index 04c77ed..29065fc 100644 --- a/mojo/public/interfaces/bindings/tests/sample_import2.mojom +++ b/mojo/public/interfaces/bindings/tests/sample_import2.mojom @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import "sample_import.mojom"; - [JavaPackage="org.chromium.mojo.bindings.test.mojom.imported"] -module imported { +module imported; + +import "sample_import.mojom"; // This sample adds more types and constants to the "imported" namespace, // to test a bug with importing multiple modules with the same namespace. @@ -26,5 +26,3 @@ struct Thing { Point location; Size size; }; - -} // module imported diff --git a/mojo/public/interfaces/bindings/tests/sample_interfaces.mojom b/mojo/public/interfaces/bindings/tests/sample_interfaces.mojom index 01e78ed..37405ca 100644 --- a/mojo/public/interfaces/bindings/tests/sample_interfaces.mojom +++ b/mojo/public/interfaces/bindings/tests/sample_interfaces.mojom @@ -5,7 +5,7 @@ [JavaPackage="org.chromium.mojo.bindings.test.mojom.sample", JavaConstantsClassName="InterfaceConstants", Foo = "hello world"] -module sample { +module sample; const uint64 kLong = 4405; @@ -24,5 +24,3 @@ interface Provider { // TODO(darin): We shouldn't need this, but JS bindings don't work without it. interface ProviderClient { }; - -} diff --git a/mojo/public/interfaces/bindings/tests/sample_service.mojom b/mojo/public/interfaces/bindings/tests/sample_service.mojom index f01d1c2..5c80781 100644 --- a/mojo/public/interfaces/bindings/tests/sample_service.mojom +++ b/mojo/public/interfaces/bindings/tests/sample_service.mojom @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +[JavaPackage="org.chromium.mojo.bindings.test.mojom.sample"] +module sample; + import "sample_import.mojom"; import "sample_import2.mojom"; -[JavaPackage="org.chromium.mojo.bindings.test.mojom.sample"] -module sample { - const uint8 kTwelve = 12; const uint64 kTooBigForSignedInt64 = 9999999999999999999; @@ -124,5 +124,3 @@ interface ServiceClient { interface Port { PostMessage@0(string message_text@0, Port port@1); }; - -} diff --git a/mojo/public/interfaces/bindings/tests/serialization_test_structs.mojom b/mojo/public/interfaces/bindings/tests/serialization_test_structs.mojom index f51c197..1239e16 100644 --- a/mojo/public/interfaces/bindings/tests/serialization_test_structs.mojom +++ b/mojo/public/interfaces/bindings/tests/serialization_test_structs.mojom @@ -3,7 +3,7 @@ // found in the LICENSE file. [JavaPackage="org.chromium.mojo.bindings.test.mojom.mojo"] -module mojo.test { +module mojo.test; struct Struct1 { uint8 i; @@ -34,5 +34,3 @@ struct StructOfNullables { Struct1? struct_1; string? str; }; - -} diff --git a/mojo/public/interfaces/bindings/tests/test_structs.mojom b/mojo/public/interfaces/bindings/tests/test_structs.mojom index 3216caf..b525a2f 100644 --- a/mojo/public/interfaces/bindings/tests/test_structs.mojom +++ b/mojo/public/interfaces/bindings/tests/test_structs.mojom @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import "mojo/public/interfaces/bindings/tests/rect.mojom"; - [JavaPackage="org.chromium.mojo.bindings.test.mojom.test_structs"] -module mojo.test { +module mojo.test; + +import "mojo/public/interfaces/bindings/tests/rect.mojom"; struct NamedRegion { string? name; @@ -137,5 +137,3 @@ struct MapValueTypes { map<string, array<array<string, 2>?>> f4; map<string, array<array<string, 2>, 1>> f5; }; - -} diff --git a/mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom b/mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom index 93393b0..290b792 100644 --- a/mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom +++ b/mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom @@ -4,7 +4,7 @@ [JavaPackage="org.chromium.mojo.bindings.test.mojom.mojo"] -module mojo.test { +module mojo.test; struct StructA { uint64 i; @@ -58,5 +58,3 @@ interface IntegrationTestInterface1 { interface IntegrationTestInterface2 { Method0() => (array<uint8> param0); }; - -} diff --git a/mojo/public/html/BUILD.gn b/mojo/public/sky/BUILD.gn index a580437..23b1492 100644 --- a/mojo/public/html/BUILD.gn +++ b/mojo/public/sky/BUILD.gn @@ -2,8 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -action_foreach("html") { - script = "convert_amd_modules_to_html.py" +action_foreach("sky") { + script = "convert_amd_modules_to_sky.py" sources = [ "//mojo/public/js/bindings/buffer.js", "//mojo/public/js/bindings/codec.js", @@ -14,12 +14,12 @@ action_foreach("html") { "//mojo/public/js/bindings/validator.js", ] outputs = [ - "$target_gen_dir/{{source_name_part}}.html", + "$target_gen_dir/{{source_name_part}}.sky", ] args = [ "--input", "{{source}}", "--output", - rebase_path(target_gen_dir, root_build_dir) + "/{{source_name_part}}.html" + rebase_path(target_gen_dir, root_build_dir) + "/{{source_name_part}}.sky" ] } diff --git a/mojo/public/html/convert_amd_modules_to_html.py b/mojo/public/sky/convert_amd_modules_to_sky.py index 20254b8..1f25438 100755 --- a/mojo/public/html/convert_amd_modules_to_html.py +++ b/mojo/public/sky/convert_amd_modules_to_sky.py @@ -7,9 +7,9 @@ import argparse import sys import re -IMPORT_TEMPLATE = '<link rel="import" href="/%s.html" as="%s" />' +IMPORT_TEMPLATE = '<import src="/%s.sky" as="%s" />' PREAMBLE_TEMPLATE = '<script>' -POSTAMBLE_TEMPLATE = ' this.exports = exports;\n</script>' +POSTAMBLE_TEMPLATE = ' module.exports = exports;\n</script>' class Import(object): def __init__(self, path, name): @@ -42,7 +42,7 @@ def AddImportNames(module, unparsed_names): module.imports[i].name = names[i] def RewritePathNames(path): - return path.replace("mojo/public/js/bindings", "mojo/public/html") + return path.replace("mojo/public/js/bindings", "mojo/public/sky") def Parse(amd_module): module = Module() diff --git a/mojo/public/tools/bindings/generators/js_templates/module.html.tmpl b/mojo/public/tools/bindings/generators/js_templates/module.sky.tmpl index f0a2236..14b0d67 100644 --- a/mojo/public/tools/bindings/generators/js_templates/module.html.tmpl +++ b/mojo/public/tools/bindings/generators/js_templates/module.sky.tmpl @@ -2,12 +2,12 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> -<link rel="import" href="/mojo/public/html/codec.html" as="codec" /> -<link rel="import" href="/mojo/public/html/validator.html" as="validator" /> +<import src="/mojo/public/sky/codec.sky" as="codec" /> +<import src="/mojo/public/sky/validator.sky" as="validator" /> {%- for import in imports %} -<link rel="import" href="/{{import.module.path}}.html" as="{{import.unique_name}}" /> +<import src="/{{import.module.path}}.sky" as="{{import.unique_name}}" /> {%- endfor %} <script> {%- include "module_definition.tmpl" %} - this.exports = exports; + module.exports = exports; </script> diff --git a/mojo/public/tools/bindings/generators/mojom_js_generator.py b/mojo/public/tools/bindings/generators/mojom_js_generator.py index d1a6147..47fea23 100644 --- a/mojo/public/tools/bindings/generators/mojom_js_generator.py +++ b/mojo/public/tools/bindings/generators/mojom_js_generator.py @@ -306,7 +306,7 @@ class Generator(generator.Generator): def GenerateAMDModule(self): return self.GetParameters() - @UseJinja("js_templates/module.html.tmpl", filters=js_filters) + @UseJinja("js_templates/module.sky.tmpl", filters=js_filters) def GenerateHTMLModule(self): return self.GetParameters() @@ -314,7 +314,7 @@ class Generator(generator.Generator): self.Write(self.GenerateAMDModule(), self.MatchMojomFilePath("%s.js" % self.module.name)) self.Write(self.GenerateHTMLModule(), - self.MatchMojomFilePath("%s.html" % self.module.name)) + self.MatchMojomFilePath("%s.sky" % self.module.name)) def GetImports(self): used_names = set() diff --git a/mojo/public/tools/bindings/mojom.gni b/mojo/public/tools/bindings/mojom.gni index e54ab0f..5a7932e 100644 --- a/mojo/public/tools/bindings/mojom.gni +++ b/mojo/public/tools/bindings/mojom.gni @@ -60,7 +60,7 @@ template("mojom") { "$generator_root/generators/js_templates/enum_definition.tmpl", "$generator_root/generators/js_templates/interface_definition.tmpl", "$generator_root/generators/js_templates/module.amd.tmpl", - "$generator_root/generators/js_templates/module.html.tmpl", + "$generator_root/generators/js_templates/module.sky.tmpl", "$generator_root/generators/js_templates/module_definition.tmpl", "$generator_root/generators/js_templates/struct_definition.tmpl", "$generator_root/generators/python_templates/module_macros.tmpl", diff --git a/mojo/public/tools/bindings/mojom_bindings_generator.gypi b/mojo/public/tools/bindings/mojom_bindings_generator.gypi index c6b10af..02c2813 100644 --- a/mojo/public/tools/bindings/mojom_bindings_generator.gypi +++ b/mojo/public/tools/bindings/mojom_bindings_generator.gypi @@ -52,7 +52,7 @@ '<(DEPTH)/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl', '<(DEPTH)/mojo/public/tools/bindings/generators/js_templates/module_definition.tmpl', '<(DEPTH)/mojo/public/tools/bindings/generators/js_templates/module.amd.tmpl', - '<(DEPTH)/mojo/public/tools/bindings/generators/js_templates/module.html.tmpl', + '<(DEPTH)/mojo/public/tools/bindings/generators/js_templates/module.sky.tmpl', '<(DEPTH)/mojo/public/tools/bindings/generators/js_templates/struct_definition.tmpl', '<(DEPTH)/mojo/public/tools/bindings/generators/python_templates/module_macros.tmpl', '<(DEPTH)/mojo/public/tools/bindings/generators/python_templates/module.py.tmpl', diff --git a/mojo/public/tools/bindings/pylib/mojom/parse/ast.py b/mojo/public/tools/bindings/pylib/mojom/parse/ast.py index 1612d98..a98a6ce 100644 --- a/mojo/public/tools/bindings/pylib/mojom/parse/ast.py +++ b/mojo/public/tools/bindings/pylib/mojom/parse/ast.py @@ -249,7 +249,7 @@ class Module(NodeBase): class Mojom(NodeBase): - """Represents an entire .mojom file. (This is the root node.""" + """Represents an entire .mojom file. (This is the root node.)""" def __init__(self, module, import_list, definition_list, **kwargs): assert module is None or isinstance(module, Module) diff --git a/mojo/public/tools/bindings/pylib/mojom/parse/parser.py b/mojo/public/tools/bindings/pylib/mojom/parse/parser.py index 35070ef..e5269c7 100644 --- a/mojo/public/tools/bindings/pylib/mojom/parse/parser.py +++ b/mojo/public/tools/bindings/pylib/mojom/parse/parser.py @@ -71,41 +71,47 @@ class Parser(object): # renaming "module" -> "package".) Then we'll be able to have a single rule # for root (by making module "optional"). def p_root_1(self, p): - """root : import_list module LBRACE definition_list RBRACE""" - p[0] = ast.Mojom(p[2], p[1], p[4]) + """root : """ + p[0] = ast.Mojom(None, ast.ImportList(), []) def p_root_2(self, p): - """root : import_list definition_list""" - p[0] = ast.Mojom(None, p[1], p[2]) - - def p_import_list_1(self, p): - """import_list : """ - p[0] = ast.ImportList() + """root : root module""" + if p[1].module is not None: + raise ParseError(self.filename, + "Multiple \"module\" statements not allowed:", + p[2].lineno, snippet=self._GetSnippet(p[2].lineno)) + if p[1].import_list.items or p[1].definition_list: + raise ParseError( + self.filename, + "\"module\" statements must precede imports and definitions:", + p[2].lineno, snippet=self._GetSnippet(p[2].lineno)) + p[0] = p[1] + p[0].module = p[2] + + def p_root_3(self, p): + """root : root import""" + if p[1].definition_list: + raise ParseError(self.filename, + "\"import\" statements must precede definitions:", + p[2].lineno, snippet=self._GetSnippet(p[2].lineno)) + p[0] = p[1] + p[0].import_list.Append(p[2]) - def p_import_list_2(self, p): - """import_list : import_list import""" + def p_root_4(self, p): + """root : root definition""" p[0] = p[1] - p[0].Append(p[2]) + p[0].definition_list.append(p[2]) def p_import(self, p): """import : IMPORT STRING_LITERAL SEMI""" # 'eval' the literal to strip the quotes. # TODO(vtl): This eval is dubious. We should unquote/unescape ourselves. - p[0] = ast.Import(eval(p[2])) + p[0] = ast.Import(eval(p[2]), filename=self.filename, lineno=p.lineno(2)) def p_module(self, p): - """module : attribute_section MODULE identifier_wrapped """ + """module : attribute_section MODULE identifier_wrapped SEMI""" p[0] = ast.Module(p[3], p[1], filename=self.filename, lineno=p.lineno(2)) - def p_definition_list(self, p): - """definition_list : definition definition_list - | """ - if len(p) > 1: - p[0] = p[2] - p[0].insert(0, p[1]) - else: - p[0] = [] - def p_definition(self, p): """definition : struct | interface @@ -271,7 +277,7 @@ class Parser(object): """fixed_array : ARRAY LANGLE typename COMMA INT_CONST_DEC RANGLE""" value = int(p[5]) if value == 0 or value > _MAX_ARRAY_SIZE: - raise ParseError(self.filename, "Fixed array size %d invalid" % value, + raise ParseError(self.filename, "Fixed array size %d invalid:" % value, lineno=p.lineno(5), snippet=self._GetSnippet(p.lineno(5))) p[0] = p[3] + "[" + p[5] + "]" diff --git a/mojo/public/tools/bindings/pylib/mojom_tests/parse/parser_unittest.py b/mojo/public/tools/bindings/pylib/mojom_tests/parse/parser_unittest.py index cc71f04..f974128 100644 --- a/mojo/public/tools/bindings/pylib/mojom_tests/parse/parser_unittest.py +++ b/mojo/public/tools/bindings/pylib/mojom_tests/parse/parser_unittest.py @@ -35,8 +35,7 @@ class ParserTest(unittest.TestCase): source = """\ // This is a comment. - module my_module { - } + module my_module; """ expected = ast.Mojom( ast.Module(('IDENTIFIER', 'my_module'), None), @@ -47,7 +46,7 @@ class ParserTest(unittest.TestCase): def testSourceWithCrLfs(self): """Tests a .mojom source with CR-LFs instead of LFs.""" - source = "// This is a comment.\r\n\r\nmodule my_module {\r\n}\r\n" + source = "// This is a comment.\r\n\r\nmodule my_module;\r\n" expected = ast.Mojom( ast.Module(('IDENTIFIER', 'my_module'), None), ast.ImportList(), @@ -60,7 +59,7 @@ class ParserTest(unittest.TestCase): source = """\ // This is a comment. - module my_module { + module my_module """ with self.assertRaisesRegexp( parser.ParseError, @@ -85,10 +84,10 @@ class ParserTest(unittest.TestCase): source2 = """\ // Consecutive C++-style comments. // Foo. - // Bar. + // Bar. struct Yada { // Baz. - // Quux. + // Quux. int32 x; }; @@ -133,14 +132,12 @@ class ParserTest(unittest.TestCase): """Tests a simple .mojom source that just defines a struct.""" source = """\ - module my_module { + module my_module; struct MyStruct { int32 a; double b; }; - - } // module my_module """ expected = ast.Mojom( ast.Module(('IDENTIFIER', 'my_module'), None), @@ -154,7 +151,7 @@ class ParserTest(unittest.TestCase): self.assertEquals(parser.Parse(source, "my_file.mojom"), expected) def testSimpleStructWithoutModule(self): - """Tests a simple struct without an enclosing module.""" + """Tests a simple struct without an explict module statement.""" source = """\ struct MyStruct { @@ -244,15 +241,14 @@ class ParserTest(unittest.TestCase): source1 = """\ // Missing module name. - module { + module ; struct MyStruct { int32 a; }; - } """ with self.assertRaisesRegexp( parser.ParseError, - r"^my_file\.mojom:2: Error: Unexpected '{':\n *module {$"): + r"^my_file\.mojom:2: Error: Unexpected ';':\n *module ;$"): parser.Parse(source1, "my_file.mojom") # Another similar case, but make sure that line-number tracking/reporting @@ -261,19 +257,77 @@ class ParserTest(unittest.TestCase): module // This line intentionally left unblank. - { - } + struct MyStruct { + int32 a; + }; """ with self.assertRaisesRegexp( parser.ParseError, - r"^my_file\.mojom:4: Error: Unexpected '{':\n *{$"): + r"^my_file\.mojom:4: Error: Unexpected 'struct':\n" + r" *struct MyStruct {$"): parser.Parse(source2, "my_file.mojom") + def testMultipleModuleStatements(self): + """Tests an (invalid) .mojom with multiple module statements.""" + + source = """\ + module foo; + module bar; + """ + with self.assertRaisesRegexp( + parser.ParseError, + r"^my_file\.mojom:2: Error: Multiple \"module\" statements not " + r"allowed:\n *module bar;$"): + parser.Parse(source, "my_file.mojom") + + def testModuleStatementAfterImport(self): + """Tests an (invalid) .mojom with a module statement after an import.""" + + source = """\ + import "foo.mojom"; + module foo; + """ + with self.assertRaisesRegexp( + parser.ParseError, + r"^my_file\.mojom:2: Error: \"module\" statements must precede imports " + r"and definitions:\n *module foo;$"): + parser.Parse(source, "my_file.mojom") + + def testModuleStatementAfterDefinition(self): + """Tests an (invalid) .mojom with a module statement after a definition.""" + + source = """\ + struct MyStruct { + int32 a; + }; + module foo; + """ + with self.assertRaisesRegexp( + parser.ParseError, + r"^my_file\.mojom:4: Error: \"module\" statements must precede imports " + r"and definitions:\n *module foo;$"): + parser.Parse(source, "my_file.mojom") + + def testImportStatementAfterDefinition(self): + """Tests an (invalid) .mojom with an import statement after a definition.""" + + source = """\ + struct MyStruct { + int32 a; + }; + import "foo.mojom"; + """ + with self.assertRaisesRegexp( + parser.ParseError, + r"^my_file\.mojom:4: Error: \"import\" statements must precede " + r"definitions:\n *import \"foo.mojom\";$"): + parser.Parse(source, "my_file.mojom") + def testEnums(self): """Tests that enum statements are correctly parsed.""" source = """\ - module my_module { + module my_module; enum MyEnum1 { VALUE1, VALUE2 }; // No trailing comma. enum MyEnum2 { VALUE1 = -1, @@ -284,7 +338,6 @@ class ParserTest(unittest.TestCase): VALUE6 = VALUE5, VALUE7, // Leave trailing comma. }; - } // my_module """ expected = ast.Mojom( ast.Module(('IDENTIFIER', 'my_module'), None), @@ -339,14 +392,12 @@ class ParserTest(unittest.TestCase): """Tests some constants and struct members initialized with them.""" source = """\ - module my_module { + module my_module; struct MyStruct { const int8 kNumber = -1; int8 number@0 = kNumber; }; - - } // my_module """ expected = ast.Mojom( ast.Module(('IDENTIFIER', 'my_module'), None), @@ -363,13 +414,11 @@ class ParserTest(unittest.TestCase): """Tests that ?: is not allowed.""" source = """\ - module my_module { + module my_module; enum MyEnum { MY_ENUM_1 = 1 ? 2 : 3 }; - - } // my_module """ with self.assertRaisesRegexp( parser.ParseError, @@ -381,7 +430,7 @@ class ParserTest(unittest.TestCase): """Tests that (valid) ordinal values are scanned correctly.""" source = """\ - module my_module { + module my_module; // This isn't actually valid .mojom, but the problem (missing ordinals) // should be handled at a different level. @@ -395,8 +444,6 @@ class ParserTest(unittest.TestCase): int32 a29 @29; int32 a1234567890 @1234567890; }; - - } // module my_module """ expected = ast.Mojom( ast.Module(('IDENTIFIER', 'my_module'), None), @@ -420,13 +467,11 @@ class ParserTest(unittest.TestCase): """Tests that (lexically) invalid ordinals are correctly detected.""" source1 = """\ - module my_module { + module my_module; struct MyStruct { int32 a_missing@; }; - - } // module my_module """ with self.assertRaisesRegexp( lexer.LexError, @@ -434,13 +479,11 @@ class ParserTest(unittest.TestCase): parser.Parse(source1, "my_file.mojom") source2 = """\ - module my_module { + module my_module; struct MyStruct { int32 a_octal@01; }; - - } // module my_module """ with self.assertRaisesRegexp( lexer.LexError, @@ -449,7 +492,7 @@ class ParserTest(unittest.TestCase): parser.Parse(source2, "my_file.mojom") source3 = """\ - module my_module { struct MyStruct { int32 a_invalid_octal@08; }; } + module my_module; struct MyStruct { int32 a_invalid_octal@08; }; """ with self.assertRaisesRegexp( lexer.LexError, @@ -457,14 +500,14 @@ class ParserTest(unittest.TestCase): r"Octal and hexadecimal ordinal values not allowed$"): parser.Parse(source3, "my_file.mojom") - source4 = "module my_module { struct MyStruct { int32 a_hex@0x1aB9; }; }" + source4 = "module my_module; struct MyStruct { int32 a_hex@0x1aB9; };" with self.assertRaisesRegexp( lexer.LexError, r"^my_file\.mojom:1: Error: " r"Octal and hexadecimal ordinal values not allowed$"): parser.Parse(source4, "my_file.mojom") - source5 = "module my_module { struct MyStruct { int32 a_hex@0X0; }; }" + source5 = "module my_module; struct MyStruct { int32 a_hex@0X0; };" with self.assertRaisesRegexp( lexer.LexError, r"^my_file\.mojom:1: Error: " @@ -487,13 +530,11 @@ class ParserTest(unittest.TestCase): """Tests that "nested" namespaces work.""" source = """\ - module my.mod { + module my.mod; struct MyStruct { int32 a; }; - - } // module my.mod """ expected = ast.Mojom( ast.Module(('IDENTIFIER', 'my.mod'), None), @@ -660,7 +701,7 @@ class ParserTest(unittest.TestCase): """ with self.assertRaisesRegexp( parser.ParseError, - r"^my_file\.mojom:2: Error: Fixed array size 0 invalid\n" + r"^my_file\.mojom:2: Error: Fixed array size 0 invalid:\n" r" *array<int32, 0> zero_size_array;$"): parser.Parse(source1, "my_file.mojom") @@ -671,7 +712,7 @@ class ParserTest(unittest.TestCase): """ with self.assertRaisesRegexp( parser.ParseError, - r"^my_file\.mojom:2: Error: Fixed array size 999999999999 invalid\n" + r"^my_file\.mojom:2: Error: Fixed array size 999999999999 invalid:\n" r" *array<int32, 999999999999> too_big_array;$"): parser.Parse(source2, "my_file.mojom") @@ -982,9 +1023,9 @@ class ParserTest(unittest.TestCase): # Imports with module statement. source3 = """\ + module my_module; import "somedir/my1.mojom"; import "somedir/my2.mojom"; - module my_module {} """ expected3 = ast.Mojom( ast.Module(('IDENTIFIER', 'my_module'), None), @@ -1008,22 +1049,26 @@ class ParserTest(unittest.TestCase): source2 = """\ import // Missing string. - module {} + struct MyStruct { + int32 a; + }; """ with self.assertRaisesRegexp( parser.ParseError, - r"^my_file\.mojom:2: Error: Unexpected 'module':\n" - r" *module {}$"): + r"^my_file\.mojom:2: Error: Unexpected 'struct':\n" + r" *struct MyStruct {$"): parser.Parse(source2, "my_file.mojom") source3 = """\ import "foo.mojom" // Missing semicolon. - module {} + struct MyStruct { + int32 a; + }; """ with self.assertRaisesRegexp( parser.ParseError, - r"^my_file\.mojom:2: Error: Unexpected 'module':\n" - r" *module {}$"): + r"^my_file\.mojom:2: Error: Unexpected 'struct':\n" + r" *struct MyStruct {$"): parser.Parse(source3, "my_file.mojom") def testValidNullableTypes(self): diff --git a/mojo/public/tools/download_shell_binary.py b/mojo/public/tools/download_shell_binary.py index 16180c4..e28034c 100755 --- a/mojo/public/tools/download_shell_binary.py +++ b/mojo/public/tools/download_shell_binary.py @@ -3,6 +3,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import argparse import os import subprocess import sys @@ -18,37 +19,48 @@ if not sys.platform.startswith("linux"): print "Not supported for your platform" sys.exit(0) -version_path = os.path.join(current_path, "../VERSION") -with open(version_path) as version_file: - version = version_file.read().strip() - prebuilt_file_path = os.path.join(current_path, "prebuilt") stamp_path = os.path.join(prebuilt_file_path, "VERSION") -try: - with open(stamp_path) as stamp_file: - current_version = stamp_file.read().strip() - if current_version == version: - sys.exit(0) -except IOError: - pass +depot_tools_path = find_depot_tools.add_depot_tools_to_path() +gsutil_exe = os.path.join(depot_tools_path, "third_party", "gsutil", "gsutil") -platform = "linux-x64" # TODO: configurate -basename = platform + ".zip" +def download(): + version_path = os.path.join(current_path, "../VERSION") + with open(version_path) as version_file: + version = version_file.read().strip() -gs_path = "gs://mojo/shell/" + version + "/" + basename + try: + with open(stamp_path) as stamp_file: + current_version = stamp_file.read().strip() + if current_version == version: + return 0 # Already have the right version. + except IOError: + pass # If the stamp file does not exist we need to download a new binary. -depot_tools_path = find_depot_tools.add_depot_tools_to_path() -gsutil_exe = os.path.join(depot_tools_path, "third_party", "gsutil", "gsutil") + platform = "linux-x64" # TODO: configurate + basename = platform + ".zip" + + gs_path = "gs://mojo/shell/" + version + "/" + basename + + with tempfile.NamedTemporaryFile() as temp_zip_file: + subprocess.check_call([gsutil_exe, "--bypass_prodaccess", + "cp", gs_path, temp_zip_file.name]) + with zipfile.ZipFile(temp_zip_file.name) as z: + zi = z.getinfo("mojo_shell") + mode = zi.external_attr >> 16L + z.extract(zi, prebuilt_file_path) + os.chmod(os.path.join(prebuilt_file_path, "mojo_shell"), mode) + + with open(stamp_path, 'w') as stamp_file: + stamp_file.write(version) + return 0 + +def main(): + parser = argparse.ArgumentParser(description="Download mojo_shell binary " + "from google storage") + parser.parse_args() + return download() -with tempfile.NamedTemporaryFile() as temp_zip_file: - subprocess.check_call([gsutil_exe, "--bypass_prodaccess", - "cp", gs_path, temp_zip_file.name]) - with zipfile.ZipFile(temp_zip_file.name) as z: - zi = z.getinfo("mojo_shell") - mode = zi.external_attr >> 16L - z.extract(zi, prebuilt_file_path) - os.chmod(os.path.join(prebuilt_file_path, "mojo_shell"), mode) - -with open(stamp_path, 'w') as stamp_file: - stamp_file.write(version + "\n") +if __name__ == "__main__": + sys.exit(main()) diff --git a/mojo/services/BUILD.gn b/mojo/services/BUILD.gn index 0fa12d9..aa2c54c 100644 --- a/mojo/services/BUILD.gn +++ b/mojo/services/BUILD.gn @@ -15,7 +15,6 @@ group("services") { "//mojo/services/public/interfaces/network", "//mojo/services/public/interfaces/surfaces", "//mojo/services/public/interfaces/view_manager", - "//mojo/services/public/interfaces/window_manager2", ] if (!is_component_build) { diff --git a/mojo/services/public/cpp/geometry/geometry_util.h b/mojo/services/public/cpp/geometry/geometry_util.h index 685170d..c238678 100644 --- a/mojo/services/public/cpp/geometry/geometry_util.h +++ b/mojo/services/public/cpp/geometry/geometry_util.h @@ -33,6 +33,7 @@ inline bool operator==(const Point& lhs, const Point& rhs) { inline bool operator!=(const Point& lhs, const Point& rhs) { return !(lhs == rhs); } + } #endif // MOJO_SERVICES_PUBLIC_CPP_GEOMETRY_GEOMETRY_UTIL_H_
\ No newline at end of file diff --git a/mojo/services/public/cpp/view_manager/BUILD.gn b/mojo/services/public/cpp/view_manager/BUILD.gn index 55fc3f8..173abf1 100644 --- a/mojo/services/public/cpp/view_manager/BUILD.gn +++ b/mojo/services/public/cpp/view_manager/BUILD.gn @@ -35,7 +35,6 @@ source_set("view_manager") { "//mojo/services/public/interfaces/surfaces:surface_id", "//mojo/services/public/interfaces/view_manager", "//mojo/services/public/interfaces/window_manager", - "//mojo/services/public/interfaces/window_manager2", ] } diff --git a/mojo/services/public/cpp/view_manager/lib/BUILD.gn b/mojo/services/public/cpp/view_manager/lib/BUILD.gn index df44a34..1f9311e 100644 --- a/mojo/services/public/cpp/view_manager/lib/BUILD.gn +++ b/mojo/services/public/cpp/view_manager/lib/BUILD.gn @@ -21,9 +21,4 @@ source_set("run_unittests") { if (use_x11) { deps += ["//ui/gfx/x"] } - - if (is_component_build) { - deps += ["//ui/gl"] - } - } diff --git a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc index 896da9d..79bde29 100644 --- a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc +++ b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc @@ -94,10 +94,6 @@ class RootObserver : public ViewObserver { ViewManagerClientImpl::ViewManagerClientImpl(ViewManagerDelegate* delegate, Shell* shell) : connected_(false), connection_id_(0), next_id_(1), delegate_(delegate) { - InterfacePtr<ServiceProvider> sp; - shell->ConnectToApplication("mojo:window_manager", GetProxy(&sp)); - ConnectToService(sp.get(), &window_manager_); - window_manager_.set_client(this); } ViewManagerClientImpl::~ViewManagerClientImpl() { @@ -170,6 +166,9 @@ void ViewManagerClientImpl::SetSurfaceId(Id view_id, SurfaceIdPtr surface_id) { } void ViewManagerClientImpl::SetFocus(Id view_id) { + // In order for us to get here we had to have exposed a view, which implies we + // got a connection. + DCHECK(window_manager_.get()); window_manager_->FocusWindow(view_id, ActionCompletedCallback()); } @@ -245,7 +244,8 @@ void ViewManagerClientImpl::OnEmbed( ConnectionSpecificId connection_id, const String& creator_url, ViewDataPtr root_data, - InterfaceRequest<ServiceProvider> service_provider) { + InterfaceRequest<ServiceProvider> parent_services, + ScopedMessagePipeHandle window_manager_pipe) { if (!connected_) { connected_ = true; connection_id_ = connection_id; @@ -264,12 +264,14 @@ void ViewManagerClientImpl::OnEmbed( ServiceProviderImpl* exported_services = nullptr; scoped_ptr<ServiceProvider> remote; - if (service_provider.is_pending()) { + if (parent_services.is_pending()) { // BindToRequest() binds the lifetime of |exported_services| to the pipe. exported_services = new ServiceProviderImpl; - BindToRequest(exported_services, &service_provider); + BindToRequest(exported_services, &parent_services); remote.reset(exported_services->CreateRemoteServiceProvider()); } + window_manager_.Bind(window_manager_pipe.Pass()); + window_manager_.set_client(this); delegate_->OnEmbed(this, root, exported_services, remote.Pass()); } @@ -360,9 +362,7 @@ void ViewManagerClientImpl::OnViewInputEvent( } //////////////////////////////////////////////////////////////////////////////// -// ViewManagerClientImpl, WindowManagerClient2 implementation: - -void ViewManagerClientImpl::OnWindowManagerReady() {} +// ViewManagerClientImpl, WindowManagerClient implementation: void ViewManagerClientImpl::OnCaptureChanged(Id old_capture_view_id, Id new_capture_view_id) {} diff --git a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h index bfbe5fc..001626ed 100644 --- a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h +++ b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h @@ -13,7 +13,7 @@ #include "mojo/services/public/cpp/view_manager/view.h" #include "mojo/services/public/cpp/view_manager/view_manager.h" #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" -#include "mojo/services/public/interfaces/window_manager2/window_manager2.mojom.h" +#include "mojo/services/public/interfaces/window_manager/window_manager.mojom.h" namespace mojo { class Shell; @@ -24,7 +24,7 @@ class ViewManagerTransaction; // Manages the connection with the View Manager service. class ViewManagerClientImpl : public ViewManager, public InterfaceImpl<ViewManagerClient>, - public WindowManagerClient2 { + public WindowManagerClient { public: ViewManagerClientImpl(ViewManagerDelegate* delegate, Shell* shell); ~ViewManagerClientImpl() override; @@ -90,7 +90,8 @@ class ViewManagerClientImpl : public ViewManager, void OnEmbed(ConnectionSpecificId connection_id, const String& creator_url, ViewDataPtr root, - InterfaceRequest<ServiceProvider> services) override; + InterfaceRequest<ServiceProvider> parent_services, + ScopedMessagePipeHandle window_manager_pipe) override; void OnViewBoundsChanged(Id view_id, RectPtr old_bounds, RectPtr new_bounds) override; @@ -111,8 +112,7 @@ class ViewManagerClientImpl : public ViewManager, EventPtr event, const Callback<void()>& callback) override; - // Overridden from WindowManagerClient2: - void OnWindowManagerReady() override; + // Overridden from WindowManagerClient: void OnCaptureChanged(Id old_capture_view_id, Id new_capture_view_id) override; void OnFocusChanged(Id old_focused_view_id, Id new_focused_view_id) override; @@ -143,7 +143,7 @@ class ViewManagerClientImpl : public ViewManager, ViewManagerService* service_; - WindowManagerService2Ptr window_manager_; + WindowManagerPtr window_manager_; DISALLOW_COPY_AND_ASSIGN(ViewManagerClientImpl); }; diff --git a/mojo/services/public/cpp/view_manager/lib/view_manager_test_suite.cc b/mojo/services/public/cpp/view_manager/lib/view_manager_test_suite.cc index abe0906..b5912ec 100644 --- a/mojo/services/public/cpp/view_manager/lib/view_manager_test_suite.cc +++ b/mojo/services/public/cpp/view_manager/lib/view_manager_test_suite.cc @@ -5,7 +5,6 @@ #include "mojo/services/public/cpp/view_manager/lib/view_manager_test_suite.h" #include "base/i18n/icu_util.h" -#include "ui/gl/gl_surface.h" #if defined(USE_X11) #include "ui/gfx/x/x11_connection.h" @@ -26,10 +25,6 @@ void ViewManagerTestSuite::Initialize() { gfx::InitializeThreadedX11(); #endif -#if defined(COMPONENT_BUILD) - gfx::GLSurface::InitializeOneOffForTests(); -#endif - base::TestSuite::Initialize(); // base::TestSuite and ViewsInit both try to load icu. That's ok for tests. diff --git a/mojo/services/public/interfaces/clipboard/clipboard.mojom b/mojo/services/public/interfaces/clipboard/clipboard.mojom index 92ef822..ca4d6b1 100644 --- a/mojo/services/public/interfaces/clipboard/clipboard.mojom +++ b/mojo/services/public/interfaces/clipboard/clipboard.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo { +module mojo; interface Clipboard { enum Type { @@ -41,5 +41,3 @@ interface Clipboard { // clear the clipboard. WriteClipboardData(Type clipboard_type, map<string, array<uint8>>? data); }; - -} // module mojo diff --git a/mojo/services/public/interfaces/content_handler/content_handler.mojom b/mojo/services/public/interfaces/content_handler/content_handler.mojom index 7230ddb..39704ee 100644 --- a/mojo/services/public/interfaces/content_handler/content_handler.mojom +++ b/mojo/services/public/interfaces/content_handler/content_handler.mojom @@ -2,13 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +module mojo; + import "mojo/public/interfaces/application/shell.mojom"; import "mojo/services/public/interfaces/network/url_loader.mojom"; -module mojo { - interface ContentHandler { StartApplication(Shell shell, URLResponse response); }; - -} diff --git a/mojo/services/public/interfaces/geometry/geometry.mojom b/mojo/services/public/interfaces/geometry/geometry.mojom index 72e4246..f8b1679 100644 --- a/mojo/services/public/interfaces/geometry/geometry.mojom +++ b/mojo/services/public/interfaces/geometry/geometry.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo { +module mojo; struct Point { int32 x; @@ -37,5 +37,3 @@ struct Transform { // Row major order. array<float, 16>? matrix; }; - -} diff --git a/mojo/services/public/interfaces/gpu/command_buffer.mojom b/mojo/services/public/interfaces/gpu/command_buffer.mojom index 302dcf4..b8b9a3d 100644 --- a/mojo/services/public/interfaces/gpu/command_buffer.mojom +++ b/mojo/services/public/interfaces/gpu/command_buffer.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo { +module mojo; struct CommandBufferState { int32 num_entries; @@ -38,5 +38,3 @@ interface CommandBufferClient { DidDestroy(); LostContext(int32 lost_reason); // TODO(piman): enum }; - -} diff --git a/mojo/services/public/interfaces/gpu/gpu.mojom b/mojo/services/public/interfaces/gpu/gpu.mojom index 49f6ae7..c3d473d 100644 --- a/mojo/services/public/interfaces/gpu/gpu.mojom +++ b/mojo/services/public/interfaces/gpu/gpu.mojom @@ -2,14 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +module mojo; + import "mojo/services/public/interfaces/geometry/geometry.mojom"; import "mojo/services/public/interfaces/gpu/command_buffer.mojom"; -module mojo { - interface Gpu { CreateOnscreenGLES2Context(uint64 native_viewport_id, Size? size, CommandBuffer&? gles2_client); CreateOffscreenGLES2Context(CommandBuffer&? gles2_client); }; - -} diff --git a/mojo/services/public/interfaces/input_events/input_event_constants.mojom b/mojo/services/public/interfaces/input_events/input_event_constants.mojom index 0de69aa..f137fb3 100644 --- a/mojo/services/public/interfaces/input_events/input_event_constants.mojom +++ b/mojo/services/public/interfaces/input_events/input_event_constants.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo { +module mojo; // This mirrors ui::EventType enum EventType { @@ -75,5 +75,3 @@ enum MouseEventFlags { // TODO(erg): Move accessibility flags and maybe synthetic touch events here. }; - -} // module mojo diff --git a/mojo/services/public/interfaces/input_events/input_events.mojom b/mojo/services/public/interfaces/input_events/input_events.mojom index 9530b6e..d06ee85 100644 --- a/mojo/services/public/interfaces/input_events/input_events.mojom +++ b/mojo/services/public/interfaces/input_events/input_events.mojom @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +module mojo; + import "mojo/services/public/interfaces/geometry/geometry.mojom"; import "mojo/services/public/interfaces/input_events/input_event_constants.mojom"; import "mojo/services/public/interfaces/input_events/input_key_codes.mojom"; -module mojo { - struct LocationData { Point? in_view_location; Point? screen_location; @@ -70,5 +70,3 @@ struct Event { TouchData? touch_data; MouseWheelData? wheel_data; }; - -} diff --git a/mojo/services/public/interfaces/input_events/input_key_codes.mojom b/mojo/services/public/interfaces/input_events/input_key_codes.mojom index bd955aa..695f5bd 100644 --- a/mojo/services/public/interfaces/input_events/input_key_codes.mojom +++ b/mojo/services/public/interfaces/input_events/input_key_codes.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo { +module mojo; // Cross platform keyboard codes. // @@ -184,5 +184,3 @@ enum KeyboardCode { // VK_OEM_AX to represent AltGr, matching the behaviour of Firefox on Linux. ALTGR = 0xE1, }; - -} // module mojo diff --git a/mojo/services/public/interfaces/native_viewport/native_viewport.mojom b/mojo/services/public/interfaces/native_viewport/native_viewport.mojom index 3d20ff4..861e1ed8 100644 --- a/mojo/services/public/interfaces/native_viewport/native_viewport.mojom +++ b/mojo/services/public/interfaces/native_viewport/native_viewport.mojom @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +module mojo; + import "mojo/services/public/interfaces/geometry/geometry.mojom"; import "mojo/services/public/interfaces/gpu/command_buffer.mojom"; import "mojo/services/public/interfaces/input_events/input_events.mojom"; import "mojo/services/public/interfaces/surfaces/surface_id.mojom"; -module mojo { - [Client=NativeViewportClient] interface NativeViewport { // TODO(sky): having a create function is awkward. Should there be a factory @@ -32,5 +32,3 @@ interface NativeViewportClient { OnSizeChanged(Size size); OnDestroyed(); }; - -} diff --git a/mojo/services/public/interfaces/navigation/navigation.mojom b/mojo/services/public/interfaces/navigation/navigation.mojom index e709317..47d0e8e 100644 --- a/mojo/services/public/interfaces/navigation/navigation.mojom +++ b/mojo/services/public/interfaces/navigation/navigation.mojom @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import "mojo/services/public/interfaces/network/url_loader.mojom"; +module mojo; -module mojo { +import "mojo/services/public/interfaces/network/url_loader.mojom"; // Expresses a preference for where a navigation will be performed. enum Target { @@ -26,5 +26,3 @@ interface NavigatorHost { // locally. For example, pushState() navigations in an HTML application. DidNavigateLocally(string url); }; - -} diff --git a/mojo/services/public/interfaces/network/cookie_store.mojom b/mojo/services/public/interfaces/network/cookie_store.mojom index 76b374a..6f2da5e 100644 --- a/mojo/services/public/interfaces/network/cookie_store.mojom +++ b/mojo/services/public/interfaces/network/cookie_store.mojom @@ -2,11 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo { +module mojo; interface CookieStore { Get(string? url) => (string? cookies); Set(string? url, string? cookie) => (bool success); }; - -} diff --git a/mojo/services/public/interfaces/network/net_address.mojom b/mojo/services/public/interfaces/network/net_address.mojom index d858242..e91973b 100644 --- a/mojo/services/public/interfaces/network/net_address.mojom +++ b/mojo/services/public/interfaces/network/net_address.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo { +module mojo; enum NetAddressFamily { UNSPECIFIED, @@ -37,6 +37,3 @@ struct NetAddress { NetAddressIPv4? ipv4; NetAddressIPv6? ipv6; }; - -} - diff --git a/mojo/services/public/interfaces/network/network_error.mojom b/mojo/services/public/interfaces/network/network_error.mojom index 4af9935..8c22948 100644 --- a/mojo/services/public/interfaces/network/network_error.mojom +++ b/mojo/services/public/interfaces/network/network_error.mojom @@ -2,11 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo { +module mojo; struct NetworkError { int32 code; string? description; }; - -} diff --git a/mojo/services/public/interfaces/network/network_service.mojom b/mojo/services/public/interfaces/network/network_service.mojom index b2bdd40..e3e4070 100644 --- a/mojo/services/public/interfaces/network/network_service.mojom +++ b/mojo/services/public/interfaces/network/network_service.mojom @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +module mojo; + import "mojo/services/public/interfaces/network/cookie_store.mojom"; import "mojo/services/public/interfaces/network/net_address.mojom"; import "mojo/services/public/interfaces/network/network_error.mojom"; @@ -11,8 +13,6 @@ import "mojo/services/public/interfaces/network/udp_socket.mojom"; import "mojo/services/public/interfaces/network/url_loader.mojom"; import "mojo/services/public/interfaces/network/web_socket.mojom"; -module mojo { - // TODO Darin suggfests that this should probably be two classes. One for // high-level origin-build requests like WebSockets and HTTP, and the other for // non-origin-bound low-level stuff like DNS, UDP, and TCP. @@ -59,5 +59,3 @@ interface NetworkService { CreateUDPSocket(UDPSocket& socket); }; - -} diff --git a/mojo/services/public/interfaces/network/tcp_bound_socket.mojom b/mojo/services/public/interfaces/network/tcp_bound_socket.mojom index 1846fc8..afcc1eb 100644 --- a/mojo/services/public/interfaces/network/tcp_bound_socket.mojom +++ b/mojo/services/public/interfaces/network/tcp_bound_socket.mojom @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +module mojo; + import "mojo/services/public/interfaces/network/net_address.mojom"; import "mojo/services/public/interfaces/network/network_error.mojom"; import "mojo/services/public/interfaces/network/tcp_connected_socket.mojom"; import "mojo/services/public/interfaces/network/tcp_server_socket.mojom"; -module mojo { - // Represents a TCP socket that is bound to a local address and port, but // is not yet in a listening or connected state. // @@ -37,5 +37,3 @@ interface TCPBoundSocket { TCPConnectedSocket& client_socket) => (NetworkError result); }; - -} diff --git a/mojo/services/public/interfaces/network/tcp_connected_socket.mojom b/mojo/services/public/interfaces/network/tcp_connected_socket.mojom index 832b496..3f0c160 100644 --- a/mojo/services/public/interfaces/network/tcp_connected_socket.mojom +++ b/mojo/services/public/interfaces/network/tcp_connected_socket.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo { +module mojo; // Represents a TCP socket connected to a remote system. // @@ -12,5 +12,3 @@ interface TCPConnectedSocket { // TODO(brettw) here we put options and what not for controlling the // connection. }; - -} diff --git a/mojo/services/public/interfaces/network/tcp_server_socket.mojom b/mojo/services/public/interfaces/network/tcp_server_socket.mojom index 09921c02..406098f 100644 --- a/mojo/services/public/interfaces/network/tcp_server_socket.mojom +++ b/mojo/services/public/interfaces/network/tcp_server_socket.mojom @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +module mojo; + import "mojo/services/public/interfaces/network/net_address.mojom"; import "mojo/services/public/interfaces/network/network_error.mojom"; import "mojo/services/public/interfaces/network/tcp_connected_socket.mojom"; -module mojo { - // Represents a TCP server socket listening for incoming requests. interface TCPServerSocket { // Waits for an incoming connection request and hooks up a TCPConnectedSocket @@ -24,5 +24,3 @@ interface TCPServerSocket { TCPConnectedSocket& client_socket) => (NetworkError result, NetAddress? remote_address); }; - -} diff --git a/mojo/services/public/interfaces/network/udp_socket.mojom b/mojo/services/public/interfaces/network/udp_socket.mojom index 3b0c72e..eed6c7c 100644 --- a/mojo/services/public/interfaces/network/udp_socket.mojom +++ b/mojo/services/public/interfaces/network/udp_socket.mojom @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +module mojo; + import "mojo/services/public/interfaces/network/net_address.mojom"; import "mojo/services/public/interfaces/network/network_error.mojom"; -module mojo { - // UDPSocket and UDPSocketClient represent a UDP socket and its client. The // typical flow of using the interfaces is: // - Acquire a UDPSocket interface pointer and set a UDPSocketClient instance. @@ -104,5 +104,3 @@ interface UDPSocketClient { // failure, |result.code| is a network error code. OnReceived(NetworkError result, NetAddress? src_addr, array<uint8>? data); }; - -} diff --git a/mojo/services/public/interfaces/network/url_loader.mojom b/mojo/services/public/interfaces/network/url_loader.mojom index e62b1d1..b258fc4 100644 --- a/mojo/services/public/interfaces/network/url_loader.mojom +++ b/mojo/services/public/interfaces/network/url_loader.mojom @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import "mojo/services/public/interfaces/network/network_error.mojom"; +module mojo; -module mojo { +import "mojo/services/public/interfaces/network/network_error.mojom"; struct URLRequest { // The URL to load. @@ -102,5 +102,3 @@ interface URLLoader { // Query status about the URLLoader. QueryStatus() => (URLLoaderStatus? status); }; - -} diff --git a/mojo/services/public/interfaces/network/web_socket.mojom b/mojo/services/public/interfaces/network/web_socket.mojom index 488746e..a91ab41 100644 --- a/mojo/services/public/interfaces/network/web_socket.mojom +++ b/mojo/services/public/interfaces/network/web_socket.mojom @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import "mojo/services/public/interfaces/network/network_error.mojom"; +module mojo; -module mojo { +import "mojo/services/public/interfaces/network/network_error.mojom"; interface WebSocket { enum MessageType { @@ -58,5 +58,3 @@ interface WebSocketClient { // didFinishOpeningHandshake // didStartClosingHandshake }; - -} diff --git a/mojo/services/public/interfaces/surfaces/quads.mojom b/mojo/services/public/interfaces/surfaces/quads.mojom index a1a8308e..d635239 100644 --- a/mojo/services/public/interfaces/surfaces/quads.mojom +++ b/mojo/services/public/interfaces/surfaces/quads.mojom @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +module mojo; + import "mojo/services/public/interfaces/geometry/geometry.mojom"; import "mojo/services/public/interfaces/surfaces/surface_id.mojom"; -module mojo { - struct Color { uint32 rgba; }; @@ -207,5 +207,3 @@ struct Pass { array<Quad> quads; array<SharedQuadState> shared_quad_states; }; - -} diff --git a/mojo/services/public/interfaces/surfaces/surface_id.mojom b/mojo/services/public/interfaces/surfaces/surface_id.mojom index 5a7686d..eb40242 100644 --- a/mojo/services/public/interfaces/surfaces/surface_id.mojom +++ b/mojo/services/public/interfaces/surfaces/surface_id.mojom @@ -2,10 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo { +module mojo; struct SurfaceId { uint64 id; }; - -} diff --git a/mojo/services/public/interfaces/surfaces/surfaces.mojom b/mojo/services/public/interfaces/surfaces/surfaces.mojom index ffa8fce..21149ab 100644 --- a/mojo/services/public/interfaces/surfaces/surfaces.mojom +++ b/mojo/services/public/interfaces/surfaces/surfaces.mojom @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +module mojo; + import "mojo/services/public/interfaces/geometry/geometry.mojom"; import "mojo/services/public/interfaces/gpu/command_buffer.mojom"; import "mojo/services/public/interfaces/surfaces/quads.mojom"; import "mojo/services/public/interfaces/surfaces/surface_id.mojom"; -module mojo { - enum ResourceFormat { RGBA_8888, RGBA_4444, @@ -69,5 +69,3 @@ interface Surface { SurfaceId id, Size size); }; - -} diff --git a/mojo/services/public/interfaces/surfaces/surfaces_service.mojom b/mojo/services/public/interfaces/surfaces/surfaces_service.mojom index f26c7aa..8045d4c 100644 --- a/mojo/services/public/interfaces/surfaces/surfaces_service.mojom +++ b/mojo/services/public/interfaces/surfaces/surfaces_service.mojom @@ -2,14 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import "mojo/services/public/interfaces/surfaces/surfaces.mojom"; +module mojo; -module mojo { +import "mojo/services/public/interfaces/surfaces/surfaces.mojom"; // Use this interface to request connections to the surfaces service. Each // connection is associated with an id namespace interface SurfacesService { CreateSurfaceConnection() => (Surface surface, uint32 id_namespace); }; - -} diff --git a/mojo/services/public/interfaces/view_manager/view_manager.mojom b/mojo/services/public/interfaces/view_manager/view_manager.mojom index a903437..b0f512f 100644 --- a/mojo/services/public/interfaces/view_manager/view_manager.mojom +++ b/mojo/services/public/interfaces/view_manager/view_manager.mojom @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +module mojo; + import "mojo/public/interfaces/application/service_provider.mojom"; import "mojo/services/public/interfaces/geometry/geometry.mojom"; import "mojo/services/public/interfaces/input_events/input_events.mojom"; import "mojo/services/public/interfaces/surfaces/surface_id.mojom"; import "mojo/services/public/interfaces/view_manager/view_manager_constants.mojom"; -module mojo { - struct ViewData { uint32 parent_id; uint32 view_id; @@ -136,11 +136,13 @@ interface ViewManagerService { [Client=ViewManagerService] interface ViewManagerClient { // Invoked when the client application has been embedded at |root|. - // See Embed() on ViewManagerService for more details. + // See Embed() on ViewManagerService for more details. |window_manager_pipe| + // is a pipe to the WindowManager. OnEmbed(uint16 connection_id, string embedder_url, ViewData root, - ServiceProvider&? service_provider); + ServiceProvider&? parent_service_provider, + handle<message_pipe> window_manager_pipe); // Invoked when a view's bounds have changed. OnViewBoundsChanged(uint32 view, @@ -188,5 +190,3 @@ interface ViewManagerClient { // Invoked when an event is targeted at the specified view. OnViewInputEvent(uint32 view, mojo.Event event) => (); }; - -} diff --git a/mojo/services/public/interfaces/view_manager/view_manager_constants.mojom b/mojo/services/public/interfaces/view_manager/view_manager_constants.mojom index 5d13805..14bd363 100644 --- a/mojo/services/public/interfaces/view_manager/view_manager_constants.mojom +++ b/mojo/services/public/interfaces/view_manager/view_manager_constants.mojom @@ -2,11 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo { +module mojo; enum OrderDirection { ABOVE = 1, BELOW, }; - -} diff --git a/mojo/services/public/interfaces/window_manager/window_manager.mojom b/mojo/services/public/interfaces/window_manager/window_manager.mojom index 754f1ed..6d108f9 100644 --- a/mojo/services/public/interfaces/window_manager/window_manager.mojom +++ b/mojo/services/public/interfaces/window_manager/window_manager.mojom @@ -2,15 +2,24 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +module mojo; + import "mojo/public/interfaces/application/service_provider.mojom"; import "mojo/services/public/interfaces/input_events/input_events.mojom"; -module mojo { - +[Client=WindowManagerClient] interface WindowManager { // Requests the WindowManager to embed the app for |url| at an appropriate // View. See ViewManger::Embed() for details on |service_provider|. Embed(string url, ServiceProvider&? service_provider); + + SetCapture(uint32 view_id) => (bool success); + FocusWindow(uint32 view_id) => (bool success); + ActivateWindow(uint32 view_id) => (bool success); }; -} +interface WindowManagerClient { + OnCaptureChanged(uint32 old_capture_view_id, uint32 new_capture_view_id); + OnFocusChanged(uint32 old_focused_node_id, uint32 new_focused_node_id); + OnActiveWindowChanged(uint32 old_focused_window, uint32 new_focused_window); +}; diff --git a/mojo/services/public/interfaces/window_manager/window_manager_internal.mojom b/mojo/services/public/interfaces/window_manager/window_manager_internal.mojom index c76bc72..54867f9 100644 --- a/mojo/services/public/interfaces/window_manager/window_manager_internal.mojom +++ b/mojo/services/public/interfaces/window_manager/window_manager_internal.mojom @@ -2,13 +2,25 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +module mojo; + import "mojo/services/public/interfaces/geometry/geometry.mojom"; import "mojo/services/public/interfaces/input_events/input_events.mojom"; -module mojo { +// WindowManagerInternal is an interface provided by the WindowManager +// exclusively to the ViewManager. +interface WindowManagerInternal { + // Creates a connection to the WindowManager specifically for a connection to + // the ViewManager. |connection_id| is the id of the connection to the + // ViewManager. See view_manager.mojom for details on the id. + CreateWindowManagerForViewManagerClient( + uint16 connection_id, + handle<message_pipe> window_manager_pipe); +}; -// ViewManager provides this interface to the WindowManager. It enables -// capabilities specific to the WindowManager. +// WindowManagerInternalClient is an interface provide by the ViewManager +// exclusively to the WindowManager. It provides functionality only available +// to the WindowManager. interface WindowManagerInternalClient { // Dispatches the specified input event to the specified view. DispatchInputEventToView(uint32 view_id, mojo.Event event); @@ -16,5 +28,3 @@ interface WindowManagerInternalClient { // Sets the native viewport size. SetViewportSize(mojo.Size size); }; - -} diff --git a/mojo/services/public/interfaces/window_manager2/BUILD.gn b/mojo/services/public/interfaces/window_manager2/BUILD.gn deleted file mode 100644 index 3067458..0000000 --- a/mojo/services/public/interfaces/window_manager2/BUILD.gn +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright 2014 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//mojo/public/tools/bindings/mojom.gni") - -# GYP version: mojo/mojo_services.gypi:mojo_core_window_manager_bindings -mojom("window_manager2") { - sources = [ - "window_manager2.mojom", - ] -} diff --git a/mojo/services/public/interfaces/window_manager2/window_manager2.mojom b/mojo/services/public/interfaces/window_manager2/window_manager2.mojom index f1b242d..c556e96 100644 --- a/mojo/services/public/interfaces/window_manager2/window_manager2.mojom +++ b/mojo/services/public/interfaces/window_manager2/window_manager2.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo { +module mojo; // TODO(sky): rethink these, and if we do in fact need it come up with a better // name. @@ -27,5 +27,3 @@ interface WindowManagerClient2 { OnFocusChanged(uint32 old_focused_node_id, uint32 new_focused_node_id); OnActiveWindowChanged(uint32 old_focused_window, uint32 new_focused_window); }; - -} diff --git a/mojo/services/public/mojo_services_public.gyp b/mojo/services/public/mojo_services_public.gyp index 5ea5221..c0e200b 100644 --- a/mojo/services/public/mojo_services_public.gyp +++ b/mojo/services/public/mojo_services_public.gyp @@ -261,20 +261,5 @@ '../../public/mojo_public.gyp:mojo_cpp_bindings', ], }, - { - # GN version: //mojo/services/public/interfaces/window_manager2 - 'target_name': 'mojo_window_manager2_bindings', - 'type': 'static_library', - 'sources': [ - 'interfaces/window_manager2/window_manager2.mojom', - ], - 'includes': [ '../../public/tools/bindings/mojom_bindings_generator.gypi' ], - 'export_dependent_settings': [ - '../../public/mojo_public.gyp:mojo_cpp_bindings', - ], - 'dependencies': [ - '../../public/mojo_public.gyp:mojo_cpp_bindings', - ], - }, ], } |