Commit 0e989ee1 authored by cmasone's avatar cmasone Committed by Commit bot

Remove redundant echo.mojom, verify non-nullables in echo_service.mojom

While looking at mojom files I'm nominally the owner of, I realized
that one had become redundant.  So, I just deleted it and checked the
other to make sure it had the right 'nullability' on the method args.

Also moved around code to build against the de-duped mojom file.

BUG=407673
TEST=build with gyp and gn

Review URL: https://codereview.chromium.org/503363004

Cr-Commit-Position: refs/heads/master@{#292054}
parent 4d7a0e04
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/logging.h" #include "base/logging.h"
#include "mojo/examples/echo/echo_service.mojom.h"
#include "mojo/public/c/system/main.h" #include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_delegate.h" #include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_impl.h" #include "mojo/public/cpp/application/application_impl.h"
...@@ -14,7 +15,6 @@ ...@@ -14,7 +15,6 @@
#include "mojo/public/cpp/environment/environment.h" #include "mojo/public/cpp/environment/environment.h"
#include "mojo/public/cpp/system/core.h" #include "mojo/public/cpp/system/core.h"
#include "mojo/public/cpp/system/macros.h" #include "mojo/public/cpp/system/macros.h"
#include "mojo/services/dbus_echo/echo.mojom.h"
namespace mojo { namespace mojo {
namespace examples { namespace examples {
...@@ -28,7 +28,7 @@ class DBusEchoApp : public ApplicationDelegate { ...@@ -28,7 +28,7 @@ class DBusEchoApp : public ApplicationDelegate {
app->ConnectToService( app->ConnectToService(
"dbus:org.chromium.EchoService/org/chromium/MojoImpl", &echo_service_); "dbus:org.chromium.EchoService/org/chromium/MojoImpl", &echo_service_);
echo_service_->Echo( echo_service_->EchoString(
String::From("who"), String::From("who"),
base::Bind(&DBusEchoApp::OnEcho, base::Unretained(this))); base::Bind(&DBusEchoApp::OnEcho, base::Unretained(this)));
} }
......
...@@ -13,17 +13,18 @@ ...@@ -13,17 +13,18 @@
#include "mojo/embedder/channel_init.h" #include "mojo/embedder/channel_init.h"
#include "mojo/embedder/embedder.h" #include "mojo/embedder/embedder.h"
#include "mojo/embedder/simple_platform_support.h" #include "mojo/embedder/simple_platform_support.h"
#include "mojo/examples/echo/echo_service.mojom.h"
#include "mojo/public/cpp/environment/environment.h" #include "mojo/public/cpp/environment/environment.h"
#include "mojo/services/dbus_echo/echo.mojom.h"
namespace { namespace {
class EchoServiceImpl : public mojo::InterfaceImpl<mojo::EchoService> { class EchoServiceImpl
: public mojo::InterfaceImpl<mojo::examples::EchoService> {
public: public:
EchoServiceImpl() {} EchoServiceImpl() {}
virtual ~EchoServiceImpl() {} virtual ~EchoServiceImpl() {}
protected: protected:
virtual void Echo( virtual void EchoString(
const mojo::String& in_to_echo, const mojo::String& in_to_echo,
const mojo::Callback<void(mojo::String)>& callback) OVERRIDE { const mojo::Callback<void(mojo::String)>& callback) OVERRIDE {
DVLOG(1) << "Asked to echo " << in_to_echo; DVLOG(1) << "Asked to echo " << in_to_echo;
...@@ -41,10 +42,10 @@ int main(int argc, char** argv) { ...@@ -41,10 +42,10 @@ int main(int argc, char** argv) {
logging::LoggingSettings settings; logging::LoggingSettings settings;
settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
logging::InitLogging(settings); logging::InitLogging(settings);
logging::SetLogItems(false, // Process ID logging::SetLogItems(false, // Process ID
false, // Thread ID false, // Thread ID
false, // Timestamp false, // Timestamp
false); // Tick count false); // Tick count
mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>( mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>(
new mojo::embedder::SimplePlatformSupport())); new mojo::embedder::SimplePlatformSupport()));
......
...@@ -825,14 +825,32 @@ ...@@ -825,14 +825,32 @@
'mojo_base.gyp:mojo_application_standalone', 'mojo_base.gyp:mojo_application_standalone',
'mojo_base.gyp:mojo_cpp_bindings', 'mojo_base.gyp:mojo_cpp_bindings',
'mojo_base.gyp:mojo_utility', 'mojo_base.gyp:mojo_utility',
'mojo_echo_bindings', 'mojo_echo_service_bindings',
'<(mojo_system_for_loadable_module)', '<(mojo_system_for_loadable_module)',
], ],
'sources': [ 'sources': [
'examples/dbus_echo/dbus_echo_app.cc', 'examples/dbus_echo/dbus_echo_app.cc',
], ],
}, },
{
'target_name': 'mojo_dbus_echo_service',
'type': 'executable',
'dependencies': [
'../base/base.gyp:base',
'../build/linux/system.gyp:dbus',
'../dbus/dbus.gyp:dbus',
'mojo_base.gyp:mojo_common_lib',
'mojo_base.gyp:mojo_system_impl',
'mojo_base.gyp:mojo_application_chromium',
'mojo_dbus_service',
'mojo_echo_service_bindings',
],
'sources': [
'examples/dbus_echo/dbus_echo_service.cc',
],
},
], ],
}], }],
], ],
} }
...@@ -4,21 +4,6 @@ ...@@ -4,21 +4,6 @@
{ {
'targets': [ 'targets': [
{
# GN version: //mojo/services/dbus_echo:bindings
'target_name': 'mojo_echo_bindings',
'type': 'static_library',
'sources': [
'services/dbus_echo/echo.mojom',
],
'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
'export_dependent_settings': [
'mojo_base.gyp:mojo_cpp_bindings',
],
'dependencies': [
'mojo_base.gyp:mojo_cpp_bindings',
],
},
{ {
'target_name': 'mojo_html_viewer', 'target_name': 'mojo_html_viewer',
'type': 'loadable_module', 'type': 'loadable_module',
...@@ -882,26 +867,5 @@ ...@@ -882,26 +867,5 @@
}, },
], ],
}], }],
['OS=="linux"', {
'targets': [
{
'target_name': 'mojo_dbus_echo_service',
'type': 'executable',
'dependencies': [
'../base/base.gyp:base',
'../build/linux/system.gyp:dbus',
'../dbus/dbus.gyp:dbus',
'mojo_base.gyp:mojo_common_lib',
'mojo_base.gyp:mojo_system_impl',
'mojo_base.gyp:mojo_application_chromium',
'mojo_dbus_service',
'mojo_echo_bindings',
],
'sources': [
'services/dbus_echo/dbus_echo_service.cc',
],
},
],
}],
], ],
} }
...@@ -6,7 +6,6 @@ import("//build/config/ui.gni") ...@@ -6,7 +6,6 @@ import("//build/config/ui.gni")
group("services") { group("services") {
deps = [ deps = [
"//mojo/services/dbus_echo:bindings",
"//mojo/services/gles2:bindings", "//mojo/services/gles2:bindings",
"//mojo/services/network", "//mojo/services/network",
"//mojo/services/public/interfaces/content_handler", "//mojo/services/public/interfaces/content_handler",
......
# 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_echo_bindings
mojom("bindings") {
sources = [
"echo.mojom",
]
}
include_rules = [
"+base",
"+mojo/dbus",
"+mojo/embedder",
]
// 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.
module mojo {
interface EchoService {
Echo(string? to_echo) => (string? echoed);
};
}
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