0

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}
This commit is contained in:
cmasone
2014-08-26 17:32:09 -07:00
committed by Commit bot
parent 4d7a0e041f
commit 0e989ee103
8 changed files with 29 additions and 75 deletions

View File

@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/logging.h"
#include "mojo/examples/echo/echo_service.mojom.h"
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_impl.h"
@ -14,7 +15,6 @@
#include "mojo/public/cpp/environment/environment.h"
#include "mojo/public/cpp/system/core.h"
#include "mojo/public/cpp/system/macros.h"
#include "mojo/services/dbus_echo/echo.mojom.h"
namespace mojo {
namespace examples {
@ -28,7 +28,7 @@ class DBusEchoApp : public ApplicationDelegate {
app->ConnectToService(
"dbus:org.chromium.EchoService/org/chromium/MojoImpl", &echo_service_);
echo_service_->Echo(
echo_service_->EchoString(
String::From("who"),
base::Bind(&DBusEchoApp::OnEcho, base::Unretained(this)));
}

View File

@ -13,17 +13,18 @@
#include "mojo/embedder/channel_init.h"
#include "mojo/embedder/embedder.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/services/dbus_echo/echo.mojom.h"
namespace {
class EchoServiceImpl : public mojo::InterfaceImpl<mojo::EchoService> {
class EchoServiceImpl
: public mojo::InterfaceImpl<mojo::examples::EchoService> {
public:
EchoServiceImpl() {}
virtual ~EchoServiceImpl() {}
protected:
virtual void Echo(
virtual void EchoString(
const mojo::String& in_to_echo,
const mojo::Callback<void(mojo::String)>& callback) OVERRIDE {
DVLOG(1) << "Asked to echo " << in_to_echo;
@ -41,10 +42,10 @@ int main(int argc, char** argv) {
logging::LoggingSettings settings;
settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
logging::InitLogging(settings);
logging::SetLogItems(false, // Process ID
false, // Thread ID
false, // Timestamp
false); // Tick count
logging::SetLogItems(false, // Process ID
false, // Thread ID
false, // Timestamp
false); // Tick count
mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>(
new mojo::embedder::SimplePlatformSupport()));

View File

@ -825,14 +825,32 @@
'mojo_base.gyp:mojo_application_standalone',
'mojo_base.gyp:mojo_cpp_bindings',
'mojo_base.gyp:mojo_utility',
'mojo_echo_bindings',
'mojo_echo_service_bindings',
'<(mojo_system_for_loadable_module)',
],
'sources': [
'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',
],
},
],
}],
],
}

View File

@ -4,21 +4,6 @@
{
'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',
'type': 'loadable_module',
@ -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',
],
},
],
}],
],
}

View File

@ -6,7 +6,6 @@ import("//build/config/ui.gni")
group("services") {
deps = [
"//mojo/services/dbus_echo:bindings",
"//mojo/services/gles2:bindings",
"//mojo/services/network",
"//mojo/services/public/interfaces/content_handler",

View File

@ -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_echo_bindings
mojom("bindings") {
sources = [
"echo.mojom",
]
}

View File

@ -1,5 +0,0 @@
include_rules = [
"+base",
"+mojo/dbus",
"+mojo/embedder",
]

View File

@ -1,11 +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.
module mojo {
interface EchoService {
Echo(string? to_echo) => (string? echoed);
};
}