Skip to content

Commit

Permalink
Update mojo sdk to rev e01f9a49449381a5eb430c1fd88bf2cae73ec35a
Browse files Browse the repository at this point in the history
Includes updates to ipc/mojo/ipc_channel_mojo.cc for mojo::embedder API
changes and updates to use mojo::Binding<> in ui/keyboard and
device/battery.

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

Cr-Commit-Position: refs/heads/master@{#304731}
  • Loading branch information
jamesr authored and Commit bot committed Nov 19, 2014
1 parent 5589991 commit a912526
Show file tree
Hide file tree
Showing 211 changed files with 7,302 additions and 3,646 deletions.
12 changes: 6 additions & 6 deletions build/all.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
# NOTE: This list of targets is present because
# mojo_base.gyp:mojo_base cannot be built on iOS, as
# javascript-related targets cause v8 to be built.
'../mojo/edk/mojo_edk.gyp:mojo_public_bindings_unittests',
'../mojo/edk/mojo_edk.gyp:mojo_public_environment_unittests',
'../mojo/edk/mojo_edk.gyp:mojo_public_system_perftests',
'../mojo/edk/mojo_edk.gyp:mojo_public_system_unittests',
'../mojo/edk/mojo_edk.gyp:mojo_public_utility_unittests',
'../mojo/edk/mojo_edk_tests.gyp:mojo_public_bindings_unittests',
'../mojo/edk/mojo_edk_tests.gyp:mojo_public_environment_unittests',
'../mojo/edk/mojo_edk_tests.gyp:mojo_public_system_perftests',
'../mojo/edk/mojo_edk_tests.gyp:mojo_public_system_unittests',
'../mojo/edk/mojo_edk_tests.gyp:mojo_public_utility_unittests',
'../mojo/edk/mojo_edk.gyp:mojo_system_impl',
'../mojo/edk/mojo_edk.gyp:mojo_system_unittests',
'../mojo/edk/mojo_edk_tests.gyp:mojo_system_unittests',
'../mojo/mojo_base.gyp:mojo_common_lib',
'../mojo/mojo_base.gyp:mojo_common_unittests',
'../mojo/public/mojo_public.gyp:mojo_cpp_bindings',
Expand Down
4 changes: 1 addition & 3 deletions content/browser/webui/web_ui_mojo_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ class PingBrowserTargetImpl : public BrowserTargetImpl {

~PingBrowserTargetImpl() override {}

// mojo::InterfaceImpl<BrowserTarget> overrides:
void OnConnectionEstablished() override { client()->Ping(); }

// Quit the RunLoop when called.
void PingResponse() override {
got_message = true;
Expand Down Expand Up @@ -134,6 +131,7 @@ class PingTestWebUIController : public TestWebUIController {
void CreateHandler(mojo::InterfaceRequest<BrowserTarget> request) {
browser_target_.reset(mojo::WeakBindToRequest(
new PingBrowserTargetImpl(run_loop_), &request));
browser_target_->client()->Ping();
}

private:
Expand Down
11 changes: 10 additions & 1 deletion content/content.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
'conditions': [
['OS != "ios"', {
'includes': [
'../build/win_precompile.gypi',
'content_common_mojo_bindings.gypi',
'content_resources.gypi',
'../build/win_precompile.gypi',
],
}],
['OS == "win"', {
Expand Down Expand Up @@ -75,6 +75,7 @@
['OS != "ios"', {
'dependencies': [
'content_child',
'content_common_mojo_bindings',
'content_gpu',
'content_plugin',
'content_ppapi_plugin',
Expand Down Expand Up @@ -174,6 +175,7 @@
}],
['OS != "ios"', {
'dependencies': [
'content_common_mojo_bindings',
'content_resources',
],
}],
Expand All @@ -190,6 +192,7 @@
'conditions': [
['OS != "ios"', {
'dependencies': [
'content_common_mojo_bindings',
'content_resources',
],
}],
Expand Down Expand Up @@ -306,6 +309,11 @@
'../v8/src/third_party/vtune/v8vtune.gyp:v8_vtune',
],
}],
['OS != "ios"', {
'dependencies': [
'content_common_mojo_bindings',
]
}]
],
'includes': [
'content_app.gypi',
Expand Down Expand Up @@ -427,6 +435,7 @@
'../device/battery/battery.gyp:device_battery_java',
'../media/media.gyp:media_java',
'../mojo/mojo_base.gyp:mojo_system_java',
'../mojo/public/mojo_public.gyp:mojo_application_bindings',
'../mojo/public/mojo_public.gyp:mojo_bindings_java',
'../net/net.gyp:net',
'../ui/android/ui_android.gyp:ui_java',
Expand Down
1 change: 0 additions & 1 deletion content/content_app.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
'dependencies': [
'../mojo/edk/mojo_edk.gyp:mojo_system_impl',
'../mojo/mojo_base.gyp:mojo_environment_chromium',
'../mojo/public/mojo_public.gyp:mojo_application_bindings',
],
}],
],
Expand Down
2 changes: 0 additions & 2 deletions content/content_browser.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -1666,10 +1666,8 @@
'app/strings/content_strings.gyp:content_strings',
'browser/devtools/devtools_resources.gyp:devtools_resources',
'browser/devtools/devtools.gyp:devtools_protocol_handler',
'content_common_mojo_bindings',
'../cc/cc.gyp:cc',
'../cc/cc.gyp:cc_surfaces',
'../mojo/public/mojo_public.gyp:mojo_application_bindings',
'../mojo/public/mojo_public.gyp:mojo_cpp_bindings',
'../mojo/public/mojo_public.gyp:mojo_js_bindings',
'../net/net.gyp:http_server',
Expand Down
1 change: 0 additions & 1 deletion content/content_child.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
'../components/tracing.gyp:tracing',
'../mojo/mojo_base.gyp:mojo_environment_chromium',
'../mojo/mojo_base.gyp:mojo_common_lib',
'../mojo/public/mojo_public.gyp:mojo_application_bindings',
'../skia/skia.gyp:skia',
'../ui/base/ui_base.gyp:ui_base',
'../ui/gfx/gfx.gyp:gfx',
Expand Down
1 change: 0 additions & 1 deletion content/content_common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,6 @@
'../media/media.gyp:shared_memory_support',
'../mojo/edk/mojo_edk.gyp:mojo_system_impl',
'../mojo/mojo_base.gyp:mojo_environment_chromium',
'../mojo/public/mojo_public.gyp:mojo_application_bindings',
'../mojo/public/mojo_public.gyp:mojo_cpp_bindings',
'../storage/storage_browser.gyp:storage',
'../storage/storage_common.gyp:storage_common',
Expand Down
39 changes: 21 additions & 18 deletions content/content_common_mojo_bindings.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,33 @@

{
'targets': [
{
'target_name': 'content_common_mojo_bindings_mojom',
'type': 'none',
'variables': {
'mojom_files': [
# NOTE: Sources duplicated in //content/common/BUILD.gn:mojo_bindings.
'common/geolocation_service.mojom',
'common/permission_service.mojom',
'common/render_frame_setup.mojom',

# NOTE: Sources duplicated in
# //content/public/common/BUILD.gn:mojo_bindings.
'public/common/mojo_geoposition.mojom',
],
},
'includes': [ '../mojo/public/tools/bindings/mojom_bindings_generator_explicit.gypi' ],
},
{
'target_name': 'content_common_mojo_bindings',
'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [
'content_common_mojo_bindings_mojom',
'../mojo/mojo_base.gyp:mojo_environment_chromium',
'../mojo/public/mojo_public.gyp:mojo_application_bindings',
'../mojo/public/mojo_public.gyp:mojo_cpp_bindings',
],
'sources': [
# NOTE: Sources duplicated in //content/common/BUILD.gn:mojo_bindings.
'common/geolocation_service.mojom',
'common/permission_service.mojom',
'common/render_frame_setup.mojom',

# NOTE: Sources duplicated in
# //content/public/common/BUILD.gn:mojo_bindings.
'public/common/mojo_geoposition.mojom',
],
'includes': [ '../mojo/public/tools/bindings/mojom_bindings_generator.gypi' ],
'export_dependent_settings': [
'../mojo/mojo_base.gyp:mojo_environment_chromium',
'../mojo/public/mojo_public.gyp:mojo_application_bindings',
'../mojo/public/mojo_public.gyp:mojo_cpp_bindings',
],
]
},
],
]
}
1 change: 0 additions & 1 deletion content/content_gpu.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
{
'dependencies': [
'../base/base.gyp:base',
'../mojo/public/mojo_public.gyp:mojo_application_bindings',
'../skia/skia.gyp:skia',
'../ui/gl/gl.gyp:gl',
],
Expand Down
1 change: 0 additions & 1 deletion content/content_plugin.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
'conditions': [
['enable_plugins==1 and OS!="linux"', {
'dependencies': [
'../mojo/public/mojo_public.gyp:mojo_application_bindings',
'../skia/skia.gyp:skia',
'../third_party/WebKit/public/blink.gyp:blink',
'../third_party/npapi/npapi.gyp:npapi',
Expand Down
1 change: 0 additions & 1 deletion content/content_ppapi_plugin.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
['enable_plugins==1', {
'dependencies': [
'../base/base.gyp:base',
'../mojo/public/mojo_public.gyp:mojo_application_bindings',
'../ppapi/ppapi_internal.gyp:ppapi_ipc',
'../ui/base/ui_base.gyp:ui_base',
'../ui/gfx/gfx.gyp:gfx',
Expand Down
2 changes: 0 additions & 2 deletions content/content_renderer.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

{
'dependencies': [
'content_common_mojo_bindings',
'../base/base.gyp:base',
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../cc/cc.gyp:cc',
Expand All @@ -18,7 +17,6 @@
'../media/media.gyp:media',
'../mojo/edk/mojo_edk.gyp:mojo_js_lib',
'../mojo/mojo_base.gyp:mojo_environment_chromium',
'../mojo/public/mojo_public.gyp:mojo_application_bindings',
'../net/net.gyp:net',
'../skia/skia.gyp:skia',
'../storage/storage_common.gyp:storage_common',
Expand Down
1 change: 0 additions & 1 deletion content/content_utility.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
'dependencies': [
'../base/base.gyp:base',
'../courgette/courgette.gyp:courgette_lib',
'../mojo/public/mojo_public.gyp:mojo_application_bindings',
],
'sources': [
'public/utility/content_utility_client.cc',
Expand Down
14 changes: 8 additions & 6 deletions device/battery/battery_monitor_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,26 @@ namespace device {
// static
void BatteryMonitorImpl::Create(
mojo::InterfaceRequest<BatteryMonitor> request) {
BindToRequest(new BatteryMonitorImpl(), &request);
new BatteryMonitorImpl(request.Pass());
}

BatteryMonitorImpl::BatteryMonitorImpl() {
BatteryMonitorImpl::BatteryMonitorImpl(
mojo::InterfaceRequest<BatteryMonitor> request)
: binding_(this, request.Pass()),
subscription_(BatteryStatusService::GetInstance()->AddCallback(
base::Bind(&BatteryMonitorImpl::DidChange, base::Unretained(this)))) {
}

BatteryMonitorImpl::~BatteryMonitorImpl() {
}

void BatteryMonitorImpl::OnConnectionEstablished() {
subscription_ = BatteryStatusService::GetInstance()->AddCallback(
base::Bind(&BatteryMonitorImpl::DidChange, base::Unretained(this)));
void BatteryMonitorImpl::RegisterSubscription() {
}

void BatteryMonitorImpl::DidChange(const BatteryStatus& battery_status) {
BatteryStatusPtr status(BatteryStatus::New());
*status = battery_status;
client()->DidChange(status.Pass());
binding_.client()->DidChange(status.Pass());
}

} // namespace device
18 changes: 10 additions & 8 deletions device/battery/battery_monitor_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef DEVICE_BATTERY_BATTERY_MONITOR_IMPL_H_
#define DEVICE_BATTERY_BATTERY_MONITOR_IMPL_H_

#include "base/memory/scoped_ptr.h"
#include "device/battery/battery_export.h"
#include "device/battery/battery_monitor.mojom.h"
#include "device/battery/battery_status_service.h"

#ifndef DEVICE_BATTERY_BATTERY_MONITOR_IMPL_H_
#define DEVICE_BATTERY_BATTERY_MONITOR_IMPL_H_
#include "mojo/public/cpp/bindings/strong_binding.h"

namespace device {

class BatteryMonitorImpl : public mojo::InterfaceImpl<BatteryMonitor> {
class BatteryMonitorImpl : public BatteryMonitor {
public:
DEVICE_BATTERY_EXPORT static void Create(
mojo::InterfaceRequest<BatteryMonitor> request);

private:
BatteryMonitorImpl();
explicit BatteryMonitorImpl(mojo::InterfaceRequest<BatteryMonitor> request);
~BatteryMonitorImpl() override;

// mojo::InterfaceImpl<..> methods:
void OnConnectionEstablished() override;

void RegisterSubscription();
void DidChange(const BatteryStatus& battery_status);

mojo::StrongBinding<BatteryMonitor> binding_;
scoped_ptr<BatteryStatusService::BatteryUpdateSubscription> subscription_;

DISALLOW_COPY_AND_ASSIGN(BatteryMonitorImpl);
};

} // namespace device
Expand Down
2 changes: 1 addition & 1 deletion ipc/mojo/ipc_channel_mojo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void ServerChannelMojo::Close() {

void ChannelMojo::ChannelInfoDeleter::operator()(
mojo::embedder::ChannelInfo* ptr) const {
mojo::embedder::DestroyChannelOnIOThread(ptr);
mojo::embedder::DestroyChannel(ptr);
}

//------------------------------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions media/mojo/services/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//mojo/public/mojo_application.gni")

# Things needed by multiple targets, like renderer_impl and renderer_app.
# GYP version: media/media.gyp:media_mojo_lib
source_set("lib") {
Expand Down Expand Up @@ -49,7 +51,7 @@ source_set("renderer_impl_lib") {

# mojo media::Renderer application.
# GYP version: media/media.gyp:mojo_media_renderer_app
shared_library("renderer_app") {
mojo_native_application("renderer_app") {
output_name = "mojo_media_renderer_app"

deps = [
Expand Down Expand Up @@ -99,7 +101,7 @@ test("mojo_media_lib_unittests") {
# libraries.
# TODO(msw): Fix GYP build for ApplicationTestBase so that we can add a GYP
# version of this test.
shared_library("media_renderer_apptest") {
mojo_native_application("media_renderer_apptest") {
testonly = true
output_name = "mojo_media_renderer_apptest"

Expand Down
2 changes: 1 addition & 1 deletion media/mojo/services/mojo_demuxer_stream_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void MojoDemuxerStreamImpl::OnBufferReady(
mojo::MediaDecoderBuffer::From(buffer));
}

void MojoDemuxerStreamImpl::OnConnectionEstablished() {
void MojoDemuxerStreamImpl::DidConnect() {
// This is called when our DemuxerStreamClient has connected itself and is
// ready to receive messages. Send an initial config and notify it that
// we are now ready for business.
Expand Down
3 changes: 1 addition & 2 deletions media/mojo/services/mojo_demuxer_stream_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ class MojoDemuxerStreamImpl : public mojo::InterfaceImpl<mojo::DemuxerStream> {
mojo::MediaDecoderBufferPtr)>& callback)
override;

// mojo::InterfaceImpl overrides.
void OnConnectionEstablished() override;
void DidConnect();

private:
// |callback| is the callback that was passed to the initiating Read()
Expand Down
12 changes: 8 additions & 4 deletions media/mojo/services/mojo_renderer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,16 @@ void MojoRendererImpl::Initialize(
demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO);

mojo::DemuxerStreamPtr audio_stream;
if (audio)
mojo::BindToProxy(new MojoDemuxerStreamImpl(audio), &audio_stream);
if (audio) {
mojo::BindToProxy(new MojoDemuxerStreamImpl(audio), &audio_stream)
->DidConnect();
}

mojo::DemuxerStreamPtr video_stream;
if (video)
mojo::BindToProxy(new MojoDemuxerStreamImpl(video), &video_stream);
if (video) {
mojo::BindToProxy(new MojoDemuxerStreamImpl(video), &video_stream)
->DidConnect();
}

remote_audio_renderer_->Initialize(
audio_stream.Pass(),
Expand Down
2 changes: 1 addition & 1 deletion mojo/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ group("tests") {
deps = [
"//mojo/common:mojo_common_unittests",
"//mojo/converters/surfaces/tests:mojo_surfaces_lib_unittests",
"//mojo/edk/js/tests:js_unittests",
"//mojo/edk/js/test:js_unittests",
"//mojo/edk/system:mojo_message_pipe_perftests",
"//mojo/edk/system:mojo_system_unittests",
"//mojo/public/c/system/tests:perftests",
Expand Down
Loading

0 comments on commit a912526

Please sign in to comment.