Commit 8bd80a65 authored by dbeam's avatar dbeam Committed by Commit bot

Revert of Third attempt to land change to remove NativeViewportService and...

Revert of Third attempt to land change to remove NativeViewportService and (patchset #2 id:20001 of https://codereview.chromium.org/578353002/)

Reason for revert:
all these tests are timing out on Win7 Tests (dbg)(4):mojo_view_manager_unittests -
https://build.chromium.org/p/chromium.win/builders/Win7%20Tests%20(dbg)(4)/builds/28279

ViewManagerTest.CantAccessChildrenOfEmbeddedView
ViewManagerTest.SecondEmbedRoot_Service
ViewManagerTest.EmbedWithSameViewId2
ViewManagerTest.EmbedWithSameViewId
ViewManagerTest.ViewsRemovedWhenEmbedding
ViewManagerTest.CantGetViewTreeOfOtherRoots
ViewManagerTest.SetViewVisibilityNotifications
ViewManagerTest.CreateView
ViewManagerTest.ViewHierarchyChangedAddingKnownToUnknown
ViewManagerTest.GetViewTree
ViewManagerTest.ViewHierarchyChangedViews
ViewManagerTest.ReuseDeletedViewId
ViewManagerTest.AddViewWithNoChange
ViewManagerTest.ReorderView
ViewManagerTest.SetViewVisibility
ViewManagerTest.CantModifyChildrenOfEmbeddedView
ViewManagerTest.OnViewInput
ViewManagerTest.CantMoveViewsFromOtherRoot
ViewManagerTest.TwoClientsGetDifferentConnectionIds
ViewManagerTest.SetViewBounds

Original issue's description:
> Third attempt to land change to remove NativeViewportService and
> ViewManager from mojo_shell.
>
> Original cl was https://codereview.chromium.org/477923004/
>
> BUG=
> TBR=ben@chromium.org
>
> Committed: https://crrev.com/9b5afe9fda3e59c856cbfc43367c2719df676af0
> Cr-Commit-Position: refs/heads/master@{#295537}

TBR=davemoore@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=

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

Cr-Commit-Position: refs/heads/master@{#295568}
parent 1edae36d
......@@ -11,7 +11,7 @@
namespace mojo {
AuraInit::AuraInit() {
aura::Env::CreateInstance(false);
aura::Env::CreateInstance(true);
context_factory_.reset(new ContextFactoryMojo);
aura::Env::GetInstance()->set_context_factory(context_factory_.get());
......
......@@ -40,7 +40,7 @@
'mojo_geometry_lib',
'mojo_html_viewer',
'mojo_js',
'mojo_native_viewport_service',
'mojo_native_viewport_service_lib',
'mojo_network_service',
'mojo_pepper_container_app',
'mojo_png_viewer',
......@@ -148,6 +148,8 @@
'../base/base.gyp:base',
'../base/base.gyp:base_static',
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../net/net.gyp:net',
'../url/url.gyp:url_lib',
'mojo_application_manager',
'mojo_base.gyp:mojo_application_bindings',
'mojo_base.gyp:mojo_common_lib',
......@@ -155,6 +157,7 @@
'mojo_base.gyp:mojo_system_impl',
'mojo_base.gyp:mojo_application_chromium',
'mojo_external_service_bindings',
'mojo_native_viewport_service_lib',
'mojo_network_bindings',
'mojo_spy',
],
......@@ -192,13 +195,10 @@
'shell/test_child_process.h',
'shell/ui_application_loader_android.cc',
'shell/ui_application_loader_android.h',
'shell/view_manager_loader.cc',
'shell/view_manager_loader.h',
],
'conditions': [
['component=="shared_library"', {
'dependencies': [
'../ui/gl/gl.gyp:gl',
],
}],
['OS=="linux"', {
'dependencies': [
'../build/linux/system.gyp:dbus',
......@@ -208,13 +208,25 @@
['OS=="android"', {
'dependencies': [
'mojo_network_service_lib',
'mojo_native_viewport_service_lib',
],
'sources': [
'shell/network_application_loader.cc',
'shell/network_application_loader.h',
],
}],
['use_aura==1', {
'dependencies': [
# These are only necessary as long as we hard code use of ViewManager.
'../skia/skia.gyp:skia',
'mojo_view_manager',
'mojo_view_manager_bindings',
],
}, { # use_aura==0
'sources!': [
'shell/view_manager_loader.cc',
'shell/view_manager_loader.h',
],
}],
],
},
{
......@@ -222,7 +234,10 @@
'target_name': 'mojo_shell_test_support',
'type': 'static_library',
'dependencies': [
'../base/base.gyp:base',
'../base/base.gyp:base_static',
'../url/url.gyp:url_lib',
'mojo_application_manager',
'mojo_base.gyp:mojo_system_impl',
'mojo_shell_lib',
],
......@@ -237,20 +252,24 @@
'type': 'executable',
'dependencies': [
'../base/base.gyp:base',
'../ui/gl/gl.gyp:gl',
'../url/url.gyp:url_lib',
'mojo_application_manager',
'mojo_base.gyp:mojo_common_lib',
'mojo_base.gyp:mojo_environment_chromium',
'mojo_base.gyp:mojo_system_impl',
'mojo_shell_lib',
],
'sources': [
'shell/desktop/mojo_main.cc',
],
'conditions': [
['component=="shared_library"', {
['use_ozone==1', {
'dependencies': [
'../ui/gfx/gfx.gyp:gfx',
'../ui/ozone/ozone.gyp:ozone',
],
}],
],
'sources': [
'shell/desktop/mojo_main.cc',
],
},
{
# GN version: //mojo/shell:mojo_shell_tests
......@@ -262,6 +281,8 @@
'../base/base.gyp:test_support_base',
'../testing/gtest.gyp:gtest',
'../net/net.gyp:net_test_support',
# TODO(vtl): We don't currently need this, but I imagine we will soon.
# '../ui/gl/gl.gyp:gl',
'../url/url.gyp:url_lib',
'mojo_application_manager',
'mojo_base.gyp:mojo_common_lib',
......@@ -299,6 +320,7 @@
'dependencies': [
'../base/base.gyp:base',
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../net/net.gyp:net',
'../url/url.gyp:url_lib',
'mojo_content_handler_bindings',
'mojo_network_bindings',
......@@ -460,6 +482,7 @@
'../ui/compositor/compositor.gyp:compositor',
'../ui/events/events.gyp:events',
'../ui/events/events.gyp:events_base',
'../ui/gl/gl.gyp:gl',
'../webkit/common/gpu/webkit_gpu.gyp:webkit_gpu',
'mojo_cc_support',
'mojo_native_viewport_bindings',
......
......@@ -81,7 +81,7 @@
],
'sources': [
'examples/sample_app/gles2_client_impl.cc',
'examples/sample_app/gles2_client_impl.h',
'examples/sample_app/gles2_client_impl.cc',
'examples/sample_app/sample_app.cc',
'examples/sample_app/spinning_cube.cc',
'examples/sample_app/spinning_cube.h',
......@@ -567,6 +567,7 @@
'../skia/skia.gyp:skia',
'../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
'../ui/gl/gl.gyp:gl',
'mojo_base.gyp:mojo_application_chromium',
'mojo_base.gyp:mojo_cpp_bindings',
'mojo_base.gyp:mojo_utility',
......@@ -662,6 +663,7 @@
'../ui/base/ui_base.gyp:ui_base',
'../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
'../ui/gl/gl.gyp:gl',
'../ui/resources/ui_resources.gyp:ui_resources',
'../ui/resources/ui_resources.gyp:ui_test_pak',
'../ui/views/views.gyp:views',
......@@ -696,6 +698,7 @@
'dependencies': [
'../base/base.gyp:base',
'../ui/gfx/gfx.gyp:gfx_geometry',
'../ui/gl/gl.gyp:gl',
'../url/url.gyp:url_lib',
'mojo_base.gyp:mojo_application_chromium',
'mojo_base.gyp:mojo_cpp_bindings',
......@@ -720,6 +723,7 @@
'dependencies': [
'../base/base.gyp:base',
'../ui/gfx/gfx.gyp:gfx_geometry',
'../ui/gl/gl.gyp:gl',
'../url/url.gyp:url_lib',
'mojo_base.gyp:mojo_application_chromium',
'mojo_base.gyp:mojo_cpp_bindings',
......
......@@ -328,6 +328,8 @@
{
# GN version: //mojo/services/native_viewport
'target_name': 'mojo_native_viewport_service_lib',
# This is linked directly into the embedder, so we make it a static_library.
# TODO(davemoore): Make this a true service.
'type': 'static_library',
'dependencies': [
'../base/base.gyp:base',
......@@ -397,21 +399,6 @@
}],
],
},
{
'target_name': 'mojo_native_viewport_service',
'type': 'loadable_module',
'dependencies': [
'mojo_native_viewport_bindings',
'mojo_native_viewport_service_lib',
'<(mojo_system_for_loadable_module)',
],
'export_dependent_settings': [
'mojo_native_viewport_bindings',
],
'sources': [
'services/native_viewport/main.cc',
],
},
{
# GN version: //mojo/services/public/interfaces/navigation
'target_name': 'mojo_navigation_bindings',
......@@ -774,7 +761,7 @@
{
# GN version: //mojo/services/view_manager
'target_name': 'mojo_view_manager',
'type': 'loadable_module',
'type': '<(component)',
'dependencies': [
'../base/base.gyp:base',
'../cc/cc.gyp:cc_surfaces',
......@@ -784,8 +771,6 @@
'../ui/events/events.gyp:events_base',
'../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
'../webkit/common/gpu/webkit_gpu.gyp:webkit_gpu',
'mojo_base.gyp:mojo_common_lib',
'mojo_base.gyp:mojo_application_chromium',
'mojo_base.gyp:mojo_common_lib',
'mojo_geometry_bindings',
......@@ -798,11 +783,7 @@
'mojo_surfaces_lib',
'mojo_view_manager_bindings',
'mojo_view_manager_common',
'mojo_gpu_bindings',
'<(mojo_system_for_loadable_module)',
# No direct dependencies, but needed for tests that use the
# view_manager.
'mojo_native_viewport_service',
'<(mojo_system_for_component)',
],
'sources': [
'services/view_manager/access_policy.h',
......@@ -828,9 +809,6 @@
'services/view_manager/window_manager_access_policy.cc',
'services/view_manager/window_manager_access_policy.h',
],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
],
'defines': [
'MOJO_VIEW_MANAGER_IMPLEMENTATION',
],
......@@ -842,6 +820,7 @@
'dependencies': [
'../base/base.gyp:base',
'../base/base.gyp:test_support_base',
'../ui/gl/gl.gyp:gl',
],
'sources': [
'services/public/cpp/view_manager/lib/view_manager_test_suite.cc',
......@@ -849,6 +828,12 @@
'services/public/cpp/view_manager/lib/view_manager_unittests.cc',
],
'conditions': [
['OS=="linux" or OS=="win"', {
'dependencies': [
'../third_party/mesa/mesa.gyp:osmesa',
'mojo_native_viewport_service_lib',
],
}],
['use_x11==1', {
'dependencies': [
'../ui/gfx/x/gfx_x11.gyp:gfx_x11',
......@@ -867,6 +852,7 @@
'../testing/gtest.gyp:gtest',
'../ui/aura/aura.gyp:aura',
'../ui/gfx/gfx.gyp:gfx_geometry',
'../ui/gl/gl.gyp:gl',
'mojo_application_manager',
'mojo_base.gyp:mojo_system_impl',
'mojo_base.gyp:mojo_application_chromium',
......@@ -878,22 +864,12 @@
'mojo_view_manager_bindings',
'mojo_view_manager_common',
'mojo_view_manager_run_unittests',
# Included only to force deps for bots.
'mojo_native_viewport_service',
'mojo_view_manager',
],
'sources': [
'services/view_manager/test_change_tracker.cc',
'services/view_manager/test_change_tracker.h',
'services/view_manager/view_manager_unittest.cc',
],
'conditions': [
['OS=="win"', {
'dependencies': [
'../ui/gfx/gfx.gyp:gfx',
],
}],
],
},
{
'target_name': 'package_mojo_view_manager',
......@@ -945,6 +921,7 @@
'dependencies': [
'../base/base.gyp:test_support_base',
'../testing/gtest.gyp:gtest',
'../ui/gl/gl.gyp:gl',
'mojo_application_manager',
'mojo_base.gyp:mojo_system_impl',
'mojo_base.gyp:mojo_environment_chromium',
......
......@@ -9,6 +9,7 @@ group("services") {
"//mojo/services/clipboard",
"//mojo/services/gles2:bindings",
"//mojo/services/html_viewer",
"//mojo/services/native_viewport",
"//mojo/services/network",
"//mojo/services/public/interfaces/clipboard",
"//mojo/services/public/interfaces/content_handler",
......@@ -21,14 +22,10 @@ group("services") {
"//mojo/services/surfaces",
"//mojo/services/test_service:bindings",
]
if (!is_android) {
deps += ["//mojo/services/native_viewport"]
}
if (use_aura) {
deps += [
"//mojo/services/public/interfaces/view_manager",
"//mojo/services/public/interfaces/window_manager",
"//mojo/services/view_manager",
"//mojo/services/window_manager",
]
}
......
......@@ -8,7 +8,5 @@ include_rules = [
"+skia",
"+third_party/WebKit/public",
"+third_party/skia/include",
"+ui/base",
"+ui/events",
"+ui/native_theme",
]
......@@ -16,13 +16,6 @@
#include "mojo/services/public/interfaces/content_handler/content_handler.mojom.h"
#include "third_party/WebKit/public/web/WebKit.h"
#if !defined(COMPONENT_BUILD)
#include "base/i18n/icu_util.h"
#include "base/path_service.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
#endif
namespace mojo {
class HTMLViewer;
......@@ -70,16 +63,6 @@ class HTMLViewer : public ApplicationDelegate,
shell_ = app->shell();
blink_platform_impl_.reset(new BlinkPlatformImpl(app));
blink::initialize(blink_platform_impl_.get());
#if !defined(COMPONENT_BUILD)
base::i18n::InitializeICU();
ui::RegisterPathProvider();
base::FilePath ui_test_pak_path;
CHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
#endif
compositor_thread_.Start();
web_media_player_factory_.reset(new WebMediaPlayerFactory(
compositor_thread_.message_loop_proxy()));
......
......@@ -4,22 +4,10 @@
import("//build/config/ui.gni")
if (!is_android) {
shared_library("native_viewport") {
output_name = "mojo_native_viewport_service"
# GYP version: mojo/mojo_services.gypi:mojo_native_viewport_service_lib
static_library("native_viewport") {
output_name = "mojo_native_viewport"
deps = [
":lib",
"//mojo/public/c/system:for_shared_library",
"//mojo/services/public/interfaces/native_viewport",
"//ui/gl",
]
sources = [ "main.cc" ]
}
}
source_set("lib") {
deps = [
"//base",
"//cc/surfaces",
......@@ -37,7 +25,6 @@ source_set("lib") {
"//ui/events/platform",
"//ui/gfx",
"//ui/gfx/geometry",
"//ui/gl",
]
sources = [
......@@ -62,6 +49,13 @@ source_set("lib") {
deps += [ "//mojo:jni_headers" ]
}
if (is_win) {
deps += [
# TODO(GYP)
# '../ui/platform_window/win/win_window.gyp:win_window',
]
}
if (use_x11) {
sources += [ "platform_viewport_x11.cc" ]
deps += [
......
include_rules = [
"+cc/surfaces",
"+gpu/command_buffer/service/mailbox_manager.h",
"+mojo/application",
"+mojo/services/public/cpp/geometry",
"+mojo/services/public/cpp/input_events",
"+mojo/services/public/cpp/surfaces",
......
// 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.
#include "base/message_loop/message_loop.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "mojo/application/application_runner_chromium.h"
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/interface_factory_impl.h"
#include "mojo/services/native_viewport/gpu_impl.h"
#include "mojo/services/native_viewport/native_viewport_impl.h"
#include "ui/gl/gl_share_group.h"
#include "ui/gl/gl_surface.h"
namespace mojo {
class NativeViewportAppDelegate
: public ApplicationDelegate,
public InterfaceFactory<NativeViewport>,
public InterfaceFactory<Gpu>,
public InterfaceFactory<NativeViewportConfig> {
public:
NativeViewportAppDelegate()
: share_group_(new gfx::GLShareGroup),
mailbox_manager_(new gpu::gles2::MailboxManager),
is_test_(false),
is_initialized_(false) {}
virtual ~NativeViewportAppDelegate() {}
private:
class NativeViewportConfigImpl : public InterfaceImpl<NativeViewportConfig> {
public:
NativeViewportConfigImpl(NativeViewportAppDelegate* app_delegate)
: app_delegate_(app_delegate) {}
virtual void UseTestConfig(
const mojo::Callback<void()>& callback) OVERRIDE {
app_delegate_->is_test_ = true;
callback.Run();
}
private:
NativeViewportAppDelegate* app_delegate_;
};
// ApplicationDelegate implementation.
virtual void Initialize(ApplicationImpl* application) OVERRIDE {
app_ = application;
}
virtual bool ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) OVERRIDE {
connection->AddService<NativeViewport>(this);
connection->AddService<Gpu>(this);
connection->AddService<NativeViewportConfig>(this);
return true;
}
// InterfaceFactory<NativeViewport> implementation.
virtual void Create(ApplicationConnection* connection,
InterfaceRequest<NativeViewport> request) OVERRIDE {
#if !defined(COMPONENT_BUILD)
if (!is_initialized_) {
if (is_test_)
gfx::GLSurface::InitializeOneOffForTests();
else
gfx::GLSurface::InitializeOneOff();
is_initialized_ = true;
}
#endif
BindToRequest(new NativeViewportImpl(app_), &request);
}
// InterfaceFactory<Gpu> implementation.
virtual void Create(ApplicationConnection* connection,
InterfaceRequest<Gpu> request) OVERRIDE {
BindToRequest(new GpuImpl(share_group_.get(), mailbox_manager_.get()),
&request);
}
// InterfaceFactory<NVTestConfig> implementation.
virtual void Create(ApplicationConnection* connection,
InterfaceRequest<NativeViewportConfig> request) OVERRIDE {
BindToRequest(new NativeViewportConfigImpl(this), &request);
}
ApplicationImpl* app_;
scoped_refptr<gfx::GLShareGroup> share_group_;
scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_;
bool is_test_;
bool is_initialized_;
DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate);
};
}
MojoResult MojoMain(MojoHandle shell_handle) {
mojo::ApplicationRunnerChromium runner(new mojo::NativeViewportAppDelegate);
runner.set_message_loop_type(base::MessageLoop::TYPE_UI);
return runner.Run(shell_handle);
}
......@@ -34,8 +34,6 @@ source_set("view_manager") {
"//mojo/services/public/cpp/surfaces",
"//mojo/services/public/interfaces/geometry",
"//mojo/services/public/interfaces/gpu",
"//mojo/services/public/interfaces/native_viewport",
"//mojo/services/public/interfaces/surfaces",
"//mojo/services/public/interfaces/view_manager",
"//mojo/services/public/interfaces/window_manager",
"//skia",
......@@ -49,7 +47,6 @@ source_set("view_manager") {
source_set("common") {
sources = [
"ids.h",
"types.h",
"types.h"
]
}
......@@ -16,14 +16,15 @@ source_set("run_unittests") {
deps = [
"//base",
"//base/test:test_support",
"//ui/gl",
]
if (use_x11) {
deps += ["//ui/gfx/x"]
if (is_linux || is_win) {
deps += [
"//third_party/mesa:osmesa",
"//mojo/services/native_viewport",
]
}
if (is_component_build) {
deps += ["//ui/gl"]
if (use_x11) {
deps += [ "//ui/gfx/x" ]
}
}
......@@ -26,11 +26,8 @@ void ViewManagerTestSuite::Initialize() {
gfx::InitializeThreadedX11();
#endif
#if defined(COMPONENT_BUILD)
gfx::GLSurface::InitializeOneOffForTests();
#endif
base::TestSuite::Initialize();
gfx::GLSurface::InitializeOneOffForTests();
// base::TestSuite and ViewsInit both try to load icu. That's ok for tests.
base::i18n::AllowMultipleInitializeCallsForTesting();
......
......@@ -26,11 +26,4 @@ interface NativeViewportClient {
OnEvent(Event event) => ();
};
// Connect to this interface before any other connections are made and call
// UseTestConfig(), blocking on the reply. This will ensure that the correct
// global initialization is done before subsequent connections.
interface NativeViewportConfig {
UseTestConfig() => ();
};
}
......@@ -2,8 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/ui.gni")
# GYP version: mojo/mojo_services.gypi:mojo_view_manager
component("view_manager") {
deps = [
......@@ -42,6 +40,7 @@ component("view_manager") {
"default_access_policy.h",
"display_manager.cc",
"display_manager.h",
"ids.h",
"main.cc",
"server_view.cc",
"server_view.h",
......@@ -66,24 +65,19 @@ test("mojo_view_manager_unittests") {
"//mojo/application",
"//mojo/application_manager",
"//mojo/environment:chromium",
"//mojo/services/public/cpp/input_events",
"//mojo/services/public/cpp/geometry",
"//mojo/services/public/cpp/view_manager",
"//mojo/services/public/cpp/view_manager/lib:run_unittests",
"//mojo/services/public/cpp/view_manager:common",
"//mojo/services/public/interfaces/input_events",
"//mojo/services/public/interfaces/geometry",
"//mojo/services/public/interfaces/view_manager",
"//mojo/shell:test_support",
"//mojo/system",
"//testing/gtest",
"//ui/gfx/geometry",
]
if (use_x11) {
deps += ["//ui/gfx/x"]
}
if (is_component_build) {
deps += ["//ui/gl"]
}
sources = [
"test_change_tracker.cc",
"test_change_tracker.h",
......
......@@ -7,6 +7,7 @@
#include "mojo/services/public/cpp/view_manager/types.h"
#include "mojo/services/public/cpp/view_manager/util.h"
#include "mojo/services/view_manager/view_manager_export.h"
namespace mojo {
namespace service {
......@@ -20,7 +21,7 @@ const ConnectionSpecificId kInvalidConnectionId = 0;
const ConnectionSpecificId kWindowManagerConnection = 1;
// Adds a bit of type safety to view ids.
struct ViewId {
struct MOJO_VIEW_MANAGER_EXPORT ViewId {
ViewId(ConnectionSpecificId connection_id, ConnectionSpecificId view_id)
: connection_id(connection_id),
view_id(view_id) {}
......
......@@ -31,10 +31,6 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/rect.h"
#if defined(OS_WIN)
#include "ui/gfx/win/window_impl.h"
#endif
namespace mojo {
namespace service {
......@@ -459,13 +455,8 @@ class ViewManagerTest : public testing::Test {
virtual void SetUp() OVERRIDE {
ASSERT_TRUE(ViewManagerProxy::IsInInitialState());
test_helper_.Init();
#if defined(OS_WIN)
// As we unload the wndproc of window classes we need to be sure to
// unregister them.
gfx::WindowImpl::UnregisterClassesAtExit();
#endif
test_helper_.Init();
test_helper_.SetLoaderForURL(
scoped_ptr<ApplicationLoader>(new EmbedApplicationLoader()),
......@@ -565,8 +556,13 @@ TEST_F(ViewManagerTest, MultipleEmbedRootsBeforeWTHReady) {
}
// Verifies client gets a valid id.
#if defined(OS_LINUX)
// http://crbug.com/396492
TEST_F(ViewManagerTest, DISABLED_ValidId) {
#define MAYBE_ValidId DISABLED_ValidId
#else
#define MAYBE_ValidId ValidId
#endif
TEST_F(ViewManagerTest, MAYBE_ValidId) {
// TODO(beng): this should really have the URL of the application that
// connected to ViewManagerInit.
EXPECT_EQ("OnEmbed creator=",
......
......@@ -38,7 +38,6 @@ source_set("lib") {
"//mojo/services/public/cpp/view_manager",
"//mojo/services/public/interfaces/window_manager",
"//ui/base",
"//ui/events",
"//ui/gfx",
"//ui/gfx/geometry",
"//ui/wm",
......@@ -66,6 +65,12 @@ test("mojo_core_window_manager_unittests") {
"//testing/gtest",
"//ui/gl",
]
if (is_linux) {
deps += [
"//third_party/mesa:osmesa",
"//mojo/services/native_viewport",
]
}
if (use_x11) {
deps += [ "//ui/gfx/x" ]
}
......
......@@ -11,11 +11,15 @@ executable("mojo_shell") {
"//base",
"//mojo/common",
"//mojo/environment:chromium",
"//ui/gfx",
"//mojo/application_manager",
"//mojo/system",
"//third_party/icu",
"//ui/gl",
"//url",
]
if (is_component_build) {
deps += ["//ui/gl"]
if (use_ozone) {
deps += [ "//ui/ozone" ]
}
sources = [
......@@ -36,9 +40,13 @@ source_set("lib") {
"//mojo/common",
"//mojo/gles2",
"//mojo/public/interfaces/application",
"//mojo/services/native_viewport",
"//mojo/services/public/interfaces/native_viewport",
"//mojo/services/public/interfaces/network",
"//mojo/spy",
"//mojo/system",
"//net",
"//url",
]
sources = [
......@@ -76,10 +84,11 @@ source_set("lib") {
]
if (is_linux) {
deps += ["//dbus"]
deps += [
"//dbus"
]
} else if (is_android) {
deps += [
"//mojo/services/native_viewport:lib",
"//mojo/services/network:lib",
]
sources += [
......@@ -87,6 +96,18 @@ source_set("lib") {
"network_application_loader.h",
]
}
if (use_aura) {
deps += [
# These are only necessary as long as we hard code use of ViewManager.
"//skia",
"//mojo/services/view_manager",
"//mojo/services/public/interfaces/view_manager",
]
sources += [
"view_manager_loader.cc",
"view_manager_loader.h",
]
}
}
mojom("app_child_process_bindings") {
......@@ -149,7 +170,10 @@ source_set("test_support") {
deps = [
":lib",
"//base",
"//base:base_static",
"//mojo/application_manager",
"//mojo/system",
"//url",
]
}
......@@ -21,24 +21,28 @@
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/services/native_viewport/gpu_impl.h"
#include "mojo/services/native_viewport/native_viewport_impl.h"
#include "mojo/shell/dynamic_application_loader.h"
#include "mojo/shell/in_process_dynamic_service_runner.h"
#include "mojo/shell/out_of_process_dynamic_service_runner.h"
#include "mojo/shell/switches.h"
#include "mojo/shell/ui_application_loader_android.h"
#include "mojo/spy/spy.h"
#include "ui/gl/gl_share_group.h"
#if defined(OS_LINUX)
#include "mojo/shell/dbus_application_loader_linux.h"
#endif // defined(OS_LINUX)
#if defined(OS_ANDROID)
#include "mojo/services/native_viewport/gpu_impl.h"
#include "mojo/services/native_viewport/native_viewport_impl.h"
#include "mojo/shell/network_application_loader.h"
#include "ui/gl/gl_share_group.h"
#endif // defined(OS_ANDROID)
#if defined(USE_AURA)
#include "mojo/shell/view_manager_loader.h"
#endif
namespace mojo {
namespace shell {
namespace {
......@@ -107,7 +111,6 @@ class EmptyServiceProvider : public InterfaceImpl<ServiceProvider> {
} // namespace
#if defined(OS_ANDROID)
class Context::NativeViewportApplicationLoader
: public ApplicationLoader,
public ApplicationDelegate,
......@@ -158,7 +161,6 @@ class Context::NativeViewportApplicationLoader
scoped_ptr<ApplicationImpl> app_;
DISALLOW_COPY_AND_ASSIGN(NativeViewportApplicationLoader);
};
#endif
Context::Context() {
DCHECK(!base::MessageLoop::current());
......@@ -199,6 +201,24 @@ void Context::Init() {
scoped_ptr<ApplicationLoader>(new NativeViewportApplicationLoader()),
this)),
GURL("mojo:mojo_native_viewport_service"));
#else
{
scoped_ptr<BackgroundShellApplicationLoader> loader(
new BackgroundShellApplicationLoader(
scoped_ptr<ApplicationLoader>(
new NativeViewportApplicationLoader()),
"native_viewport",
base::MessageLoop::TYPE_UI));
application_manager_.SetLoaderForURL(
loader.PassAs<ApplicationLoader>(),
GURL("mojo:mojo_native_viewport_service"));
}
#endif
#if defined(USE_AURA)
// TODO(sky): need a better way to find this. It shouldn't be linked in.
application_manager_.SetLoaderForURL(
scoped_ptr<ApplicationLoader>(new ViewManagerLoader()),
GURL("mojo:mojo_view_manager"));
#endif
#if defined(OS_LINUX)
......
......@@ -12,21 +12,14 @@
#include "mojo/shell/init.h"
#include "mojo/shell/switches.h"
#include "ui/gfx/switches.h"
#if defined(COMPONENT_BUILD)
#include "ui/gl/gl_surface.h"
#endif
namespace {
void RunApps(mojo::shell::Context* context) {
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
base::CommandLine::StringVector args = command_line.GetArgs();
for (base::CommandLine::StringVector::const_iterator it = args.begin();
it != args.end();
++it) {
context->Run(GURL(*it));
void RunApps(mojo::shell::Context* context, std::vector<GURL> app_urls) {
for (std::vector<GURL>::const_iterator it = app_urls.begin();
it != app_urls.end(); ++it) {
context->Run(*it);
}
}
......@@ -50,9 +43,8 @@ int main(int argc, char** argv) {
*base::CommandLine::ForCurrentProcess())) {
child_process->Main();
} else {
#if defined(COMPONENT_BUILD)
gfx::GLSurface::InitializeOneOff();
#endif
// We want the shell::Context to outlive the MessageLoop so that pipes are
// all gracefully closed / error-out before we try to shut the Context down.
mojo::shell::Context shell_context;
......@@ -67,7 +59,17 @@ int main(int argc, char** argv) {
GURL(command_line.GetSwitchValueASCII(switches::kOrigin)));
}
message_loop.PostTask(FROM_HERE, base::Bind(RunApps, &shell_context));
std::vector<GURL> app_urls;
base::CommandLine::StringVector args = command_line.GetArgs();
for (base::CommandLine::StringVector::const_iterator it = args.begin();
it != args.end();
++it)
app_urls.push_back(GURL(*it));
message_loop.PostTask(FROM_HERE,
base::Bind(RunApps,
&shell_context,
app_urls));
message_loop.Run();
}
}
......
......@@ -112,9 +112,8 @@ void InProcessDynamicServiceRunner::Run() {
#if !defined(COMPONENT_BUILD)
// Warn on this really weird case: The library requires the GLES2
// control functions, but doesn't require the GLES2 implementation.
LOG(WARNING) << app_path_.value()
<< " has MojoSetGLES2ControlThunks, "
"but doesn't have MojoSetGLES2ImplThunks.";
LOG(WARNING) << "App library has MojoSetGLES2ControlThunks, but "
"doesn't have MojoSetGLES2ImplThunks.";
#endif
}
......@@ -145,8 +144,9 @@ void InProcessDynamicServiceRunner::Run() {
LOG(ERROR) << "MojoMain returned an error: " << result;
} while (false);
app_completed_callback_runner_.Run();
bool success = app_completed_callback_runner_.Run();
app_completed_callback_runner_.Reset();
LOG_IF(ERROR, !success) << "Failed post run app_completed_callback";
}
} // namespace shell
......
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