diff options
author | sky <sky@chromium.org> | 2015-08-06 18:06:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-07 01:07:34 +0000 |
commit | add030b55dee834423004bde2a0d92afd8a7be7e (patch) | |
tree | d7e3af2db33ba8e700d15a80f40a003336ba9523 | |
parent | 1efe8793da85ee6e25185175047c077adfe8e55c (diff) | |
download | chromium_src-add030b55dee834423004bde2a0d92afd8a7be7e.zip chromium_src-add030b55dee834423004bde2a0d92afd8a7be7e.tar.gz chromium_src-add030b55dee834423004bde2a0d92afd8a7be7e.tar.bz2 |
Straightens outs DEPS in mojo/common
Prior to this change //mojo/environment depended upon //mojo/common. //mojo/common's deps are wrong and it needs to be depend upon various things in //third_party/mojo/src/mojo... When these DEPS are added link errors result because Environment and and a couple of other things need to be defined. These are defined in //mojo/environment. But //mojo/environment can't be a dep of //mojo/common, else we get a cycle.
To straighten this out I've moved the files //mojo/environment needs from //mojo/common to //mojo/message_pump. //mojo/environment no longer depends upon //mojo/common, only //mojo/message_pump. //mojo/common can then depend upon //mojo/environment and we no longer have the cycle. Yay!
BUG=none
TEST=none
Committed: https://crrev.com/a11b4d76a27816fe025af647825becac5f633c34
Cr-Commit-Position: refs/heads/master@{#341979}
Review URL: https://codereview.chromium.org/1262173005
Cr-Commit-Position: refs/heads/master@{#342252}
57 files changed, 191 insertions, 100 deletions
@@ -79,15 +79,14 @@ check_targets = [ "mojo/application/*", "mojo/build/*", "mojo/cc/*", - - # TODO(sky): resolve this. - # "mojo/common/*", + "mojo/common/*", "mojo/converters/*", "mojo/environment/*", # TODO(sky): resolve this. # "mojo/gles2/*", "mojo/gpu/*", + "mojo/message_pump/*", "mojo/nacl/*", # TODO(sky): resolve this. diff --git a/chrome/DEPS b/chrome/DEPS index 0672af6..b5972c7 100644 --- a/chrome/DEPS +++ b/chrome/DEPS @@ -25,6 +25,7 @@ include_rules = [ "+content/public/common", "+content/public/test", "+mojo/common", + "+mojo/message_pump", # Don't allow inclusion of these other libs we shouldn't be calling directly. "-webkit", diff --git a/chrome/browser/media/router/media_router_mojo_test.h b/chrome/browser/media/router/media_router_mojo_test.h index 41a4884..0a2e933 100644 --- a/chrome/browser/media/router/media_router_mojo_test.h +++ b/chrome/browser/media/router/media_router_mojo_test.h @@ -12,7 +12,7 @@ #include "chrome/browser/media/router/mock_media_router.h" #include "chrome/browser/media/router/test_helper.h" #include "chrome/test/base/testing_profile.h" -#include "mojo/common/message_pump_mojo.h" +#include "mojo/message_pump/message_pump_mojo.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 8cf1e3e..e248ac8 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -3291,6 +3291,7 @@ '../mojo/mojo_base.gyp:mojo_application_base', '../mojo/mojo_base.gyp:mojo_common_lib', '../mojo/mojo_base.gyp:mojo_environment_chromium', + '../mojo/mojo_base.gyp:mojo_message_pump_lib', '../net/net.gyp:net_extras', '../net/net.gyp:net_with_v8', '../storage/storage_browser.gyp:storage', diff --git a/components/html_viewer/BUILD.gn b/components/html_viewer/BUILD.gn index 484b96f..dcbdaf2 100644 --- a/components/html_viewer/BUILD.gn +++ b/components/html_viewer/BUILD.gn @@ -156,6 +156,7 @@ source_set("lib") { "//mojo/cc", "//mojo/common", "//mojo/converters/surfaces", + "//mojo/message_pump", "//mojo/platform_handle", "//mojo/services/network/public/cpp", "//mojo/services/network/public/interfaces", diff --git a/components/html_viewer/DEPS b/components/html_viewer/DEPS index 7c58938..8355e5b 100644 --- a/components/html_viewer/DEPS +++ b/components/html_viewer/DEPS @@ -21,6 +21,7 @@ include_rules = [ "+mojo/common", "+mojo/converters/geometry", "+mojo/converters/surfaces", + "+mojo/message_pump", "+mojo/platform_handle", "+mojo/public", "+mojo/services/network", diff --git a/components/html_viewer/web_socket_handle_impl.h b/components/html_viewer/web_socket_handle_impl.h index 6487642..9929748 100644 --- a/components/html_viewer/web_socket_handle_impl.h +++ b/components/html_viewer/web_socket_handle_impl.h @@ -7,7 +7,7 @@ #include "base/macros.h" #include "base/memory/scoped_ptr.h" -#include "mojo/common/handle_watcher.h" +#include "mojo/message_pump/handle_watcher.h" #include "mojo/services/network/public/interfaces/web_socket.mojom.h" #include "third_party/WebKit/public/platform/WebSocketHandle.h" diff --git a/components/html_viewer/web_url_loader_impl.h b/components/html_viewer/web_url_loader_impl.h index 7ff3a43..9acc027 100644 --- a/components/html_viewer/web_url_loader_impl.h +++ b/components/html_viewer/web_url_loader_impl.h @@ -8,7 +8,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "components/html_viewer/mock_web_blob_registry_impl.h" -#include "mojo/common/handle_watcher.h" +#include "mojo/message_pump/handle_watcher.h" #include "mojo/services/network/public/interfaces/url_loader.mojom.h" #include "third_party/WebKit/public/platform/WebBlobData.h" #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" diff --git a/components/message_port.gypi b/components/message_port.gypi index 498405e..7891058 100644 --- a/components/message_port.gypi +++ b/components/message_port.gypi @@ -9,7 +9,7 @@ 'type': 'static_library', 'dependencies': [ '../base/base.gyp:base', - '../mojo/mojo_base.gyp:mojo_common_lib', + '../mojo/mojo_base.gyp:mojo_message_pump_lib', '../third_party/WebKit/public/blink.gyp:blink', '../third_party/mojo/mojo_public.gyp:mojo_system_cpp_headers', ], diff --git a/components/message_port/BUILD.gn b/components/message_port/BUILD.gn index 3a81750..63c7da1 100644 --- a/components/message_port/BUILD.gn +++ b/components/message_port/BUILD.gn @@ -10,7 +10,7 @@ source_set("message_port") { public_deps = [ "//base", - "//mojo/common", + "//mojo/message_pump", "//third_party/WebKit/public:blink", "//third_party/mojo/src/mojo/public/cpp/system", ] diff --git a/components/message_port/DEPS b/components/message_port/DEPS index eba876f..4f27eb3 100644 --- a/components/message_port/DEPS +++ b/components/message_port/DEPS @@ -1,6 +1,6 @@ include_rules = [ "+base", - "+mojo/common", + "+mojo/message_pump", "+third_party/WebKit/public", "+third_party/mojo/src/mojo/public/cpp/system", ] diff --git a/components/message_port/web_message_port_channel_impl.h b/components/message_port/web_message_port_channel_impl.h index 49fe97e..12d6c28 100644 --- a/components/message_port/web_message_port_channel_impl.h +++ b/components/message_port/web_message_port_channel_impl.h @@ -6,7 +6,7 @@ #define COMPONENTS_MESSAGE_PORT_WEB_MESSAGE_PORT_CHANNEL_IMPL_H_ #include "base/basictypes.h" -#include "mojo/common/handle_watcher.h" +#include "mojo/message_pump/handle_watcher.h" #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" #include "third_party/mojo/src/mojo/public/cpp/system/message_pipe.h" diff --git a/content/DEPS b/content/DEPS index 85f0d20..da7660a 100644 --- a/content/DEPS +++ b/content/DEPS @@ -33,6 +33,7 @@ include_rules = [ "+dbus", "+gpu", "+mojo/common", + "+mojo/message_pump", "+net", "+ppapi", "+printing", diff --git a/content/child/BUILD.gn b/content/child/BUILD.gn index 9698873..0d13f5d 100644 --- a/content/child/BUILD.gn +++ b/content/child/BUILD.gn @@ -32,6 +32,7 @@ source_set("child") { "//mojo/application/public/interfaces", "//mojo/common", "//mojo/environment:chromium", + "//mojo/message_pump", "//skia", "//third_party/icu", "//ui/base", diff --git a/content/child/web_data_consumer_handle_impl.h b/content/child/web_data_consumer_handle_impl.h index 78f20f6..6db36b7 100644 --- a/content/child/web_data_consumer_handle_impl.h +++ b/content/child/web_data_consumer_handle_impl.h @@ -7,7 +7,7 @@ #include "base/memory/scoped_ptr.h" #include "content/common/content_export.h" -#include "mojo/common/handle_watcher.h" +#include "mojo/message_pump/handle_watcher.h" #include "third_party/WebKit/public/platform/WebDataConsumerHandle.h" #include "third_party/mojo/src/mojo/public/cpp/system/data_pipe.h" diff --git a/content/content_child.gypi b/content/content_child.gypi index 557f699..2fdd780 100644 --- a/content/content_child.gypi +++ b/content/content_child.gypi @@ -10,6 +10,7 @@ '../components/webcrypto/webcrypto.gyp:webcrypto', '../mojo/mojo_base.gyp:mojo_environment_chromium', '../mojo/mojo_base.gyp:mojo_common_lib', + '../mojo/mojo_base.gyp:mojo_message_pump_lib', '../skia/skia.gyp:skia', '../ui/base/ui_base.gyp:ui_base', '../ui/events/events.gyp:gestures_blink', diff --git a/content/content_utility.gypi b/content/content_utility.gypi index 96d81f8..6eb535f 100644 --- a/content/content_utility.gypi +++ b/content/content_utility.gypi @@ -9,6 +9,7 @@ '../mojo/mojo_base.gyp:mojo_application_base', '../mojo/mojo_base.gyp:mojo_application_bindings', '../mojo/mojo_base.gyp:mojo_common_lib', + '../mojo/mojo_base.gyp:mojo_message_pump_lib', '../mojo/mojo_shell.gyp:mojo_shell_lib', '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings', '../url/url.gyp:url_lib', diff --git a/mandoline/services/core_services/BUILD.gn b/mandoline/services/core_services/BUILD.gn index 84808a5..2a34b61 100644 --- a/mandoline/services/core_services/BUILD.gn +++ b/mandoline/services/core_services/BUILD.gn @@ -47,6 +47,7 @@ source_set("sources") { "//mandoline/ui/browser:lib", "//mojo/application/public/cpp", "//mojo/common:tracing_impl", + "//mojo/message_pump", "//mojo/services/tracing:lib", "//third_party/mojo/src/mojo/public/cpp/bindings", ] diff --git a/mandoline/services/core_services/DEPS b/mandoline/services/core_services/DEPS index 308fa909..90dcddc 100644 --- a/mandoline/services/core_services/DEPS +++ b/mandoline/services/core_services/DEPS @@ -5,6 +5,7 @@ include_rules = [ "+components/view_manager", "+mojo/application", "+mojo/common", + "+mojo/message_pump", "+mojo/services/network", "+mojo/services/tracing", "+net", diff --git a/mandoline/services/core_services/core_services_application_delegate.cc b/mandoline/services/core_services/core_services_application_delegate.cc index e3ff977..7805164 100644 --- a/mandoline/services/core_services/core_services_application_delegate.cc +++ b/mandoline/services/core_services/core_services_application_delegate.cc @@ -14,7 +14,7 @@ #include "mojo/application/public/cpp/application_connection.h" #include "mojo/application/public/cpp/application_impl.h" #include "mojo/application/public/cpp/application_runner.h" -#include "mojo/common/message_pump_mojo.h" +#include "mojo/message_pump/message_pump_mojo.h" #include "mojo/services/tracing/tracing_app.h" #include "url/gurl.h" diff --git a/mojo/android/BUILD.gn b/mojo/android/BUILD.gn index 684f547..78ddc27 100644 --- a/mojo/android/BUILD.gn +++ b/mojo/android/BUILD.gn @@ -27,8 +27,8 @@ generate_jni("jni_headers") { generate_jni("system_java_jni_headers") { sources = [ - "system/src/org/chromium/mojo/system/impl/CoreImpl.java", "system/src/org/chromium/mojo/system/impl/BaseRunLoop.java", + "system/src/org/chromium/mojo/system/impl/CoreImpl.java", ] jni_package = "mojo" @@ -46,7 +46,7 @@ source_set("libsystem_java") { ":system_java_jni_headers", "//base", "//mojo/environment:chromium", - "//mojo/common:common", + "//mojo/message_pump", "//third_party/mojo/src/mojo/edk/system", "//third_party/mojo/src/mojo/public/cpp/environment", ] @@ -125,7 +125,7 @@ shared_library("mojo_java_unittests") { ":system_java_jni_headers", "//base", "//base/test/:test_support", - "//mojo/common", + "//mojo/message_pump", "//third_party/mojo/src/mojo/edk/system", "//third_party/mojo/src/mojo/public/cpp/bindings/tests:mojo_public_bindings_test_utils", "//third_party/mojo/src/mojo/public/cpp/test_support:test_utils", diff --git a/mojo/android/javatests/mojo_test_case.cc b/mojo/android/javatests/mojo_test_case.cc index 419d14d..3408227 100644 --- a/mojo/android/javatests/mojo_test_case.cc +++ b/mojo/android/javatests/mojo_test_case.cc @@ -13,8 +13,7 @@ #include "base/run_loop.h" #include "base/test/test_support_android.h" #include "jni/MojoTestCase_jni.h" -#include "mojo/common/message_pump_mojo.h" - +#include "mojo/message_pump/message_pump_mojo.h" #include "mojo/public/cpp/environment/environment.h" namespace { diff --git a/mojo/android/system/base_run_loop.cc b/mojo/android/system/base_run_loop.cc index df33f01..2bc2fb4 100644 --- a/mojo/android/system/base_run_loop.cc +++ b/mojo/android/system/base_run_loop.cc @@ -12,7 +12,7 @@ #include "base/bind.h" #include "base/message_loop/message_loop.h" #include "jni/BaseRunLoop_jni.h" -#include "mojo/common/message_pump_mojo.h" +#include "mojo/message_pump/message_pump_mojo.h" namespace mojo { namespace android { diff --git a/mojo/application/public/cpp/BUILD.gn b/mojo/application/public/cpp/BUILD.gn index 6351691..0181322 100644 --- a/mojo/application/public/cpp/BUILD.gn +++ b/mojo/application/public/cpp/BUILD.gn @@ -48,6 +48,7 @@ source_set("sources") { "//mojo/application/public/interfaces", "//mojo/common", "//mojo/environment:chromium", + "//mojo/message_pump", "//third_party/mojo/src/mojo/public/cpp/bindings", "//third_party/mojo/src/mojo/public/cpp/system", ] @@ -70,9 +71,7 @@ source_set("content_handler") { # TODO: this code should not depend on base. "//base", "//mojo/application/public/interfaces:interfaces_cpp_sources", - - # TODO: this code should not depend on mojo/common. - "//mojo/common:common_base", + "//mojo/message_pump", "//mojo/services/network/public/interfaces", ] } diff --git a/mojo/application/public/cpp/lib/application_runner.cc b/mojo/application/public/cpp/lib/application_runner.cc index 0418d91..3127892 100644 --- a/mojo/application/public/cpp/lib/application_runner.cc +++ b/mojo/application/public/cpp/lib/application_runner.cc @@ -12,7 +12,7 @@ #include "base/threading/worker_pool.h" #include "mojo/application/public/cpp/application_delegate.h" #include "mojo/application/public/cpp/application_impl.h" -#include "mojo/common/message_pump_mojo.h" +#include "mojo/message_pump/message_pump_mojo.h" namespace mojo { diff --git a/mojo/application/public/cpp/lib/content_handler_factory.cc b/mojo/application/public/cpp/lib/content_handler_factory.cc index a05c954..3ce666f 100644 --- a/mojo/application/public/cpp/lib/content_handler_factory.cc +++ b/mojo/application/public/cpp/lib/content_handler_factory.cc @@ -17,7 +17,7 @@ #include "mojo/application/public/cpp/application_impl.h" #include "mojo/application/public/cpp/application_runner.h" #include "mojo/application/public/cpp/interface_factory_impl.h" -#include "mojo/common/message_pump_mojo.h" +#include "mojo/message_pump/message_pump_mojo.h" #include "mojo/public/cpp/bindings/strong_binding.h" namespace mojo { diff --git a/mojo/common/BUILD.gn b/mojo/common/BUILD.gn index 99f0ba5..6dfed2f 100644 --- a/mojo/common/BUILD.gn +++ b/mojo/common/BUILD.gn @@ -21,13 +21,6 @@ component("common_base") { "data_pipe_file_utils.cc", "data_pipe_utils.cc", "data_pipe_utils.h", - "handle_watcher.cc", - "handle_watcher.h", - "message_pump_mojo.cc", - "message_pump_mojo.h", - "message_pump_mojo_handler.h", - "time_helper.cc", - "time_helper.h", "user_agent.cc", "user_agent.h", "weak_binding_set.h", @@ -39,7 +32,11 @@ component("common_base") { deps = [ "//base", "//base/third_party/dynamic_annotations", + "//mojo/environment:chromium", "//third_party/mojo/src/mojo/public/c/system:for_component", + "//third_party/mojo/src/mojo/public/cpp/bindings", + "//third_party/mojo/src/mojo/public/cpp/environment", + "//third_party/mojo/src/mojo/public/cpp/system", ] } @@ -78,6 +75,7 @@ test("mojo_common_unittests") { "//base:message_loop_tests", "//base/test:test_support", "//mojo/environment:chromium", + "//mojo/message_pump", "//testing/gtest", "//third_party/mojo/src/mojo/edk/test:run_all_unittests", "//third_party/mojo/src/mojo/edk/test:test_support", @@ -87,9 +85,11 @@ test("mojo_common_unittests") { ] sources = [ + # The message_pump tests are so small and some what related to this code + # that we put them here. + "../message_pump/handle_watcher_unittest.cc", + "../message_pump/message_pump_mojo_unittest.cc", "common_type_converters_unittest.cc", - "handle_watcher_unittest.cc", - "message_pump_mojo_unittest.cc", ] } diff --git a/mojo/environment/BUILD.gn b/mojo/environment/BUILD.gn index 9621dfb..d233c3b 100644 --- a/mojo/environment/BUILD.gn +++ b/mojo/environment/BUILD.gn @@ -55,7 +55,8 @@ component("chromium_impl") { deps = [ "//base", "//base/third_party/dynamic_annotations", - "//mojo/common:common_base", + "//mojo/message_pump", + "//third_party/mojo/src/mojo/public/c/system:for_component", "//third_party/mojo/src/mojo/public/cpp/environment:environment", ] } diff --git a/mojo/environment/default_async_waiter_impl.cc b/mojo/environment/default_async_waiter_impl.cc index ff7a5247..5178edd 100644 --- a/mojo/environment/default_async_waiter_impl.cc +++ b/mojo/environment/default_async_waiter_impl.cc @@ -5,7 +5,7 @@ #include "mojo/environment/default_async_waiter_impl.h" #include "base/bind.h" -#include "mojo/common/handle_watcher.h" +#include "mojo/message_pump/handle_watcher.h" namespace mojo { namespace internal { diff --git a/mojo/message_pump/BUILD.gn b/mojo/message_pump/BUILD.gn new file mode 100644 index 0000000..b8132a1 --- /dev/null +++ b/mojo/message_pump/BUILD.gn @@ -0,0 +1,26 @@ +# Copyright 2015 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("//testing/test.gni") + +component("message_pump") { + sources = [ + "handle_watcher.cc", + "handle_watcher.h", + "message_pump_mojo.cc", + "message_pump_mojo.h", + "message_pump_mojo_handler.h", + "time_helper.cc", + "time_helper.h", + ] + + defines = [ "MOJO_MESSAGE_PUMP_IMPLEMENTATION" ] + + deps = [ + "//base", + "//base/third_party/dynamic_annotations", + "//third_party/mojo/src/mojo/public/c/system:for_component", + "//third_party/mojo/src/mojo/public/cpp/system", + ] +} diff --git a/mojo/common/handle_watcher.cc b/mojo/message_pump/handle_watcher.cc index 6bff0cd..d02c761 100644 --- a/mojo/common/handle_watcher.cc +++ b/mojo/message_pump/handle_watcher.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "mojo/common/handle_watcher.h" +#include "mojo/message_pump/handle_watcher.h" #include <map> @@ -21,9 +21,9 @@ #include "base/threading/thread.h" #include "base/threading/thread_restrictions.h" #include "base/time/time.h" -#include "mojo/common/message_pump_mojo.h" -#include "mojo/common/message_pump_mojo_handler.h" -#include "mojo/common/time_helper.h" +#include "mojo/message_pump/message_pump_mojo.h" +#include "mojo/message_pump/message_pump_mojo_handler.h" +#include "mojo/message_pump/time_helper.h" namespace mojo { namespace common { diff --git a/mojo/common/handle_watcher.h b/mojo/message_pump/handle_watcher.h index 9056ec4..4f7115a 100644 --- a/mojo/common/handle_watcher.h +++ b/mojo/message_pump/handle_watcher.h @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef MOJO_COMMON_HANDLE_WATCHER_H_ -#define MOJO_COMMON_HANDLE_WATCHER_H_ +#ifndef MOJO_MESSAGE_PUMP_HANDLE_WATCHER_H_ +#define MOJO_MESSAGE_PUMP_HANDLE_WATCHER_H_ #include "base/basictypes.h" #include "base/callback_forward.h" #include "base/memory/scoped_ptr.h" #include "base/run_loop.h" -#include "mojo/common/mojo_common_export.h" +#include "mojo/message_pump/mojo_message_pump_export.h" #include "third_party/mojo/src/mojo/public/cpp/system/core.h" namespace base { @@ -24,7 +24,7 @@ class HandleWatcherTest; // HandleWatcher is used to asynchronously wait on a handle and notify a Closure // when the handle is ready, or the deadline has expired. -class MOJO_COMMON_EXPORT HandleWatcher { +class MOJO_MESSAGE_PUMP_EXPORT HandleWatcher { public: HandleWatcher(); @@ -61,4 +61,4 @@ class MOJO_COMMON_EXPORT HandleWatcher { } // namespace common } // namespace mojo -#endif // MOJO_COMMON_HANDLE_WATCHER_H_ +#endif // MOJO_MESSAGE_PUMP_HANDLE_WATCHER_H_ diff --git a/mojo/common/handle_watcher_unittest.cc b/mojo/message_pump/handle_watcher_unittest.cc index 41d5ffb..bfbfa9f 100644 --- a/mojo/common/handle_watcher_unittest.cc +++ b/mojo/message_pump/handle_watcher_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "mojo/common/handle_watcher.h" +#include "mojo/message_pump/handle_watcher.h" #include <string> @@ -13,8 +13,8 @@ #include "base/run_loop.h" #include "base/test/simple_test_tick_clock.h" #include "base/threading/thread.h" -#include "mojo/common/message_pump_mojo.h" -#include "mojo/common/time_helper.h" +#include "mojo/message_pump/message_pump_mojo.h" +#include "mojo/message_pump/time_helper.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/mojo/src/mojo/public/cpp/system/core.h" #include "third_party/mojo/src/mojo/public/cpp/test_support/test_utils.h" diff --git a/mojo/common/message_pump_mojo.cc b/mojo/message_pump/message_pump_mojo.cc index afbf8f9..a24349b 100644 --- a/mojo/common/message_pump_mojo.cc +++ b/mojo/message_pump/message_pump_mojo.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "mojo/common/message_pump_mojo.h" +#include "mojo/message_pump/message_pump_mojo.h" #include <algorithm> #include <vector> @@ -12,8 +12,8 @@ #include "base/logging.h" #include "base/threading/thread_local.h" #include "base/time/time.h" -#include "mojo/common/message_pump_mojo_handler.h" -#include "mojo/common/time_helper.h" +#include "mojo/message_pump/message_pump_mojo_handler.h" +#include "mojo/message_pump/time_helper.h" namespace mojo { namespace common { diff --git a/mojo/common/message_pump_mojo.h b/mojo/message_pump/message_pump_mojo.h index 86dd8ac..d4028f1 100644 --- a/mojo/common/message_pump_mojo.h +++ b/mojo/message_pump/message_pump_mojo.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef MOJO_COMMON_MESSAGE_PUMP_MOJO_H_ -#define MOJO_COMMON_MESSAGE_PUMP_MOJO_H_ +#ifndef MOJO_MESSAGE_PUMP_MESSAGE_PUMP_MOJO_H_ +#define MOJO_MESSAGE_PUMP_MESSAGE_PUMP_MOJO_H_ #include <map> @@ -13,7 +13,7 @@ #include "base/observer_list.h" #include "base/synchronization/lock.h" #include "base/time/time.h" -#include "mojo/common/mojo_common_export.h" +#include "mojo/message_pump/mojo_message_pump_export.h" #include "third_party/mojo/src/mojo/public/cpp/system/core.h" namespace mojo { @@ -22,9 +22,9 @@ namespace common { class MessagePumpMojoHandler; // Mojo implementation of MessagePump. -class MOJO_COMMON_EXPORT MessagePumpMojo : public base::MessagePump { +class MOJO_MESSAGE_PUMP_EXPORT MessagePumpMojo : public base::MessagePump { public: - class Observer { + class MOJO_MESSAGE_PUMP_EXPORT Observer { public: Observer() {} @@ -133,4 +133,4 @@ class MOJO_COMMON_EXPORT MessagePumpMojo : public base::MessagePump { } // namespace common } // namespace mojo -#endif // MOJO_COMMON_MESSAGE_PUMP_MOJO_H_ +#endif // MOJO_MESSAGE_PUMP_MESSAGE_PUMP_MOJO_H_ diff --git a/mojo/common/message_pump_mojo_handler.h b/mojo/message_pump/message_pump_mojo_handler.h index dd136ed..35ae036 100644 --- a/mojo/common/message_pump_mojo_handler.h +++ b/mojo/message_pump/message_pump_mojo_handler.h @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef MOJO_COMMON_MESSAGE_PUMP_MOJO_HANDLER_H_ -#define MOJO_COMMON_MESSAGE_PUMP_MOJO_HANDLER_H_ +#ifndef MOJO_MESSAGE_PUMP_MESSAGE_PUMP_MOJO_HANDLER_H_ +#define MOJO_MESSAGE_PUMP_MESSAGE_PUMP_MOJO_HANDLER_H_ -#include "mojo/common/mojo_common_export.h" +#include "mojo/message_pump/mojo_message_pump_export.h" #include "third_party/mojo/src/mojo/public/cpp/system/core.h" namespace mojo { @@ -13,7 +13,7 @@ namespace common { // Used by MessagePumpMojo to notify when a handle is either ready or has become // invalid. In case of error, the handler will be removed. -class MOJO_COMMON_EXPORT MessagePumpMojoHandler { +class MOJO_MESSAGE_PUMP_EXPORT MessagePumpMojoHandler { public: virtual void OnHandleReady(const Handle& handle) = 0; @@ -26,4 +26,4 @@ class MOJO_COMMON_EXPORT MessagePumpMojoHandler { } // namespace common } // namespace mojo -#endif // MOJO_COMMON_MESSAGE_PUMP_MOJO_HANDLER_H_ +#endif // MOJO_MESSAGE_PUMP_MESSAGE_PUMP_MOJO_HANDLER_H_ diff --git a/mojo/common/message_pump_mojo_unittest.cc b/mojo/message_pump/message_pump_mojo_unittest.cc index 5d695f6..51f3670 100644 --- a/mojo/common/message_pump_mojo_unittest.cc +++ b/mojo/message_pump/message_pump_mojo_unittest.cc @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "mojo/common/message_pump_mojo.h" +#include "mojo/message_pump/message_pump_mojo.h" #include "base/message_loop/message_loop_test.h" #include "base/run_loop.h" -#include "mojo/common/message_pump_mojo_handler.h" +#include "mojo/message_pump/message_pump_mojo_handler.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/mojo/src/mojo/public/cpp/system/core.h" diff --git a/mojo/message_pump/mojo_message_pump_export.h b/mojo/message_pump/mojo_message_pump_export.h new file mode 100644 index 0000000..f8c1864 --- /dev/null +++ b/mojo/message_pump/mojo_message_pump_export.h @@ -0,0 +1,32 @@ +// Copyright 2015 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. + +#ifndef MOJO_MESSAGE_PUMP_MOJO_MESSAGE_PUMP_EXPORT_H_ +#define MOJO_MESSAGE_PUMP_MOJO_MESSAGE_PUMP_EXPORT_H_ + +#if defined(COMPONENT_BUILD) + +#if defined(WIN32) + +#if defined(MOJO_MESSAGE_PUMP_IMPLEMENTATION) +#define MOJO_MESSAGE_PUMP_EXPORT __declspec(dllexport) +#else +#define MOJO_MESSAGE_PUMP_EXPORT __declspec(dllimport) +#endif + +#else // !defined(WIN32) + +#if defined(MOJO_MESSAGE_PUMP_IMPLEMENTATION) +#define MOJO_MESSAGE_PUMP_EXPORT __attribute__((visibility("default"))) +#else +#define MOJO_MESSAGE_PUMP_EXPORT +#endif + +#endif // defined(WIN32) + +#else // !defined(COMPONENT_BUILD) +#define MOJO_MESSAGE_PUMP_EXPORT +#endif + +#endif // MOJO_MESSAGE_PUMP_MOJO_MESSAGE_PUMP_EXPORT_H_ diff --git a/mojo/common/time_helper.cc b/mojo/message_pump/time_helper.cc index 36fd087..ffd667e 100644 --- a/mojo/common/time_helper.cc +++ b/mojo/message_pump/time_helper.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "mojo/common/time_helper.h" +#include "mojo/message_pump/time_helper.h" #include "base/time/tick_clock.h" diff --git a/mojo/common/time_helper.h b/mojo/message_pump/time_helper.h index 365ae04..6079000 100644 --- a/mojo/common/time_helper.h +++ b/mojo/message_pump/time_helper.h @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef MOJO_COMMON_TIME_HELPER_H_ -#define MOJO_COMMON_TIME_HELPER_H_ +#ifndef MOJO_MESSAGE_PUMP_TIME_HELPER_H_ +#define MOJO_MESSAGE_PUMP_TIME_HELPER_H_ #include "base/time/time.h" -#include "mojo/common/mojo_common_export.h" +#include "mojo/message_pump/mojo_message_pump_export.h" namespace base { class TickClock; @@ -18,17 +18,17 @@ namespace test { // Sets the TickClock used for getting TimeTicks::Now(). This is currently used // by both HandleWatcher and MessagePumpMojo. -MOJO_COMMON_EXPORT void SetTickClockForTest(base::TickClock* clock); +MOJO_MESSAGE_PUMP_EXPORT void SetTickClockForTest(base::TickClock* clock); } // namespace test namespace internal { // Returns now. Used internally; generally not useful. -MOJO_COMMON_EXPORT base::TimeTicks NowTicks(); +MOJO_MESSAGE_PUMP_EXPORT base::TimeTicks NowTicks(); } // namespace internal } // namespace common } // namespace mojo -#endif // MOJO_COMMON_TIME_HELPER_H_ +#endif // MOJO_MESSAGE_PUMP_TIME_HELPER_H_ diff --git a/mojo/mojo_base.gyp b/mojo/mojo_base.gyp index 550c41d..6b1d251 100644 --- a/mojo/mojo_base.gyp +++ b/mojo/mojo_base.gyp @@ -36,6 +36,31 @@ 'type': 'none', }, { + # GN version: //mojo/message_pump + 'target_name': 'mojo_message_pump_lib', + 'type': '<(component)', + 'defines': [ + 'MOJO_MESSAGE_PUMP_IMPLEMENTATION', + ], + 'dependencies': [ + '../base/base.gyp:base', + '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', + '<(mojo_system_for_component)', + ], + 'export_dependent_settings': [ + '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', + ], + 'sources': [ + 'message_pump/handle_watcher.cc', + 'message_pump/handle_watcher.h', + 'message_pump/message_pump_mojo.cc', + 'message_pump/message_pump_mojo.h', + 'message_pump/message_pump_mojo_handler.h', + 'message_pump/time_helper.cc', + 'message_pump/time_helper.h', + ], + }, + { # GN version: //mojo/common 'target_name': 'mojo_common_lib', 'type': '<(component)', @@ -56,13 +81,6 @@ 'common/data_pipe_file_utils.cc', 'common/data_pipe_utils.cc', 'common/data_pipe_utils.h', - 'common/handle_watcher.cc', - 'common/handle_watcher.h', - 'common/message_pump_mojo.cc', - 'common/message_pump_mojo.h', - 'common/message_pump_mojo_handler.h', - 'common/time_helper.cc', - 'common/time_helper.h', ], }, { @@ -112,19 +130,20 @@ '../base/base.gyp:base_message_loop_tests', '../testing/gtest.gyp:gtest', '../url/url.gyp:url_lib', - 'mojo_common_lib', - 'mojo_url_type_converters', '../third_party/mojo/mojo_edk.gyp:mojo_system_impl', '../third_party/mojo/mojo_edk.gyp:mojo_common_test_support', '../third_party/mojo/mojo_edk.gyp:mojo_run_all_unittests', - 'mojo_environment_chromium', '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings', '../third_party/mojo/mojo_public.gyp:mojo_public_test_utils', + 'mojo_common_lib', + 'mojo_environment_chromium', + 'mojo_message_pump_lib', + 'mojo_url_type_converters', ], 'sources': [ 'common/common_type_converters_unittest.cc', - 'common/handle_watcher_unittest.cc', - 'common/message_pump_mojo_unittest.cc', + 'message_pump/handle_watcher_unittest.cc', + 'message_pump/message_pump_mojo_unittest.cc', ], }, { @@ -136,7 +155,6 @@ '../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings', ], 'sources': [ - 'environment/environment.cc', # TODO(vtl): This is kind of ugly. (See TODO in logging.h.) "../third_party/mojo/src/mojo/public/cpp/environment/async_waiter.h", "../third_party/mojo/src/mojo/public/cpp/environment/lib/async_waiter.cc", @@ -145,6 +163,7 @@ "../third_party/mojo/src/mojo/public/cpp/environment/lib/scoped_task_tracking.cc", "../third_party/mojo/src/mojo/public/cpp/environment/logging.h", "../third_party/mojo/src/mojo/public/cpp/environment/task_tracker.h", + 'environment/environment.cc', ], 'include_dirs': [ '..', @@ -169,7 +188,7 @@ 'dependencies': [ '../base/base.gyp:base', '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', - 'mojo_common_lib', + 'mojo_message_pump_lib', '<(mojo_system_for_component)', ], 'sources': [ @@ -240,7 +259,7 @@ ], 'dependencies': [ 'mojo_application_bindings', - 'mojo_common_lib', + 'mojo_message_pump_lib', ], }, { diff --git a/mojo/runner/BUILD.gn b/mojo/runner/BUILD.gn index 1744441..89cf5ec 100644 --- a/mojo/runner/BUILD.gn +++ b/mojo/runner/BUILD.gn @@ -33,6 +33,7 @@ source_set("mojo_runner_lib") { "//build/config/sanitizers:deps", "//mojo/common", "//mojo/environment:chromium", + "//mojo/message_pump", ] if (!is_android) { @@ -127,11 +128,12 @@ source_set("lib") { "//components/devtools_service/public/interfaces", "//mojo/application/public/cpp", "//mojo/common:tracing_impl", - "//mojo/util:filename_util", - "//third_party/mojo/src/mojo/edk/system", + "//mojo/message_pump", "//mojo/services/network/public/interfaces", - "//mojo/shell", "//mojo/services/tracing:bindings", + "//mojo/shell", + "//mojo/util:filename_util", + "//third_party/mojo/src/mojo/edk/system", "//ui/gl", "//url", ] @@ -439,6 +441,7 @@ test("mojo_runner_unittests") { "//mojo/application/public/cpp", "//mojo/common", "//mojo/environment:chromium", + "//mojo/message_pump", "//mojo/services/test_service:bindings", "//mojo/shell", "//mojo/util:filename_util", diff --git a/mojo/runner/android/main.cc b/mojo/runner/android/main.cc index c395dfa..fcd3749 100644 --- a/mojo/runner/android/main.cc +++ b/mojo/runner/android/main.cc @@ -20,7 +20,7 @@ #include "base/run_loop.h" #include "components/view_manager/android_loader.h" #include "jni/ShellMain_jni.h" -#include "mojo/common/message_pump_mojo.h" +#include "mojo/message_pump/message_pump_mojo.h" #include "mojo/runner/android/android_handler_loader.h" #include "mojo/runner/android/background_application_loader.h" #include "mojo/runner/android/context_init.h" diff --git a/mojo/runner/child_process.cc b/mojo/runner/child_process.cc index 9966934..eda7829 100644 --- a/mojo/runner/child_process.cc +++ b/mojo/runner/child_process.cc @@ -20,12 +20,12 @@ #include "base/thread_task_runner_handle.h" #include "base/threading/thread.h" #include "base/threading/thread_checker.h" -#include "mojo/common/message_pump_mojo.h" #include "mojo/edk/embedder/embedder.h" #include "mojo/edk/embedder/platform_channel_pair.h" #include "mojo/edk/embedder/process_delegate.h" #include "mojo/edk/embedder/scoped_platform_handle.h" #include "mojo/edk/embedder/simple_platform_support.h" +#include "mojo/message_pump/message_pump_mojo.h" #include "mojo/public/cpp/system/core.h" #include "mojo/runner/child_process.mojom.h" #include "mojo/runner/native_application_support.h" diff --git a/mojo/runner/child_process_host_unittest.cc b/mojo/runner/child_process_host_unittest.cc index 0443c46..b4482b7 100644 --- a/mojo/runner/child_process_host_unittest.cc +++ b/mojo/runner/child_process_host_unittest.cc @@ -9,7 +9,7 @@ #include "base/logging.h" #include "base/macros.h" #include "base/message_loop/message_loop.h" -#include "mojo/common/message_pump_mojo.h" +#include "mojo/message_pump/message_pump_mojo.h" #include "mojo/runner/context.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/mojo/services/network/BUILD.gn b/mojo/services/network/BUILD.gn index 0b9e804..e01a567 100644 --- a/mojo/services/network/BUILD.gn +++ b/mojo/services/network/BUILD.gn @@ -93,6 +93,7 @@ source_set("lib") { "//mojo/application/public/cpp", "//mojo/common:common_base", "//mojo/common:url_type_converters", + "//mojo/message_pump", "//mojo/services/network/public/cpp", "//mojo/services/network/public/interfaces", "//net", @@ -139,6 +140,7 @@ mojo_native_application("apptests") { "//mojo/application/public/cpp:sources", "//mojo/application/public/cpp:test_support", "//mojo/common:common_base", + "//mojo/message_pump", "//mojo/services/network/public/cpp", "//mojo/services/network/public/interfaces", "//net", diff --git a/mojo/services/network/DEPS b/mojo/services/network/DEPS index 64f12dc..fa4edaa 100644 --- a/mojo/services/network/DEPS +++ b/mojo/services/network/DEPS @@ -3,6 +3,7 @@ include_rules = [ "+components/filesystem/public/interfaces", "+mojo/application", "+mojo/common", + "+mojo/message_pump", "+mojo/services", "+mojo/util", "+net", diff --git a/mojo/services/network/http_connection_impl.cc b/mojo/services/network/http_connection_impl.cc index 552ddee..965c27e 100644 --- a/mojo/services/network/http_connection_impl.cc +++ b/mojo/services/network/http_connection_impl.cc @@ -12,7 +12,7 @@ #include "base/logging.h" #include "base/stl_util.h" #include "base/strings/string_util.h" -#include "mojo/common/handle_watcher.h" +#include "mojo/message_pump/handle_watcher.h" #include "mojo/services/network/http_server_impl.h" #include "mojo/services/network/net_adapters.h" #include "mojo/services/network/public/cpp/web_socket_read_queue.h" diff --git a/mojo/services/network/network_service_delegate.cc b/mojo/services/network/network_service_delegate.cc index 55ab0c3..71d40ea 100644 --- a/mojo/services/network/network_service_delegate.cc +++ b/mojo/services/network/network_service_delegate.cc @@ -12,7 +12,7 @@ #include "base/message_loop/message_loop.h" #include "base/path_service.h" #include "mojo/application/public/cpp/application_connection.h" -#include "mojo/common/message_pump_mojo.h" +#include "mojo/message_pump/message_pump_mojo.h" #include "mojo/services/network/network_service_delegate_observer.h" #include "mojo/services/network/network_service_impl.h" #include "mojo/services/network/url_loader_factory_impl.h" diff --git a/mojo/services/network/public/DEPS b/mojo/services/network/public/DEPS index 86a3623..3a9fdf7 100644 --- a/mojo/services/network/public/DEPS +++ b/mojo/services/network/public/DEPS @@ -4,7 +4,7 @@ include_rules = [ "-net", "-services", "-testing", - "!mojo/common", + "!mojo/message_pump", "+mojo/services/network/public", "+third_party/mojo/src/mojo/public", ] diff --git a/mojo/services/network/public/cpp/BUILD.gn b/mojo/services/network/public/cpp/BUILD.gn index 52af16b..030636c 100644 --- a/mojo/services/network/public/cpp/BUILD.gn +++ b/mojo/services/network/public/cpp/BUILD.gn @@ -20,8 +20,8 @@ mojo_sdk_source_set("cpp") { "../interfaces", "//base", "//mojo/application/public/cpp", - "//mojo/common", "//mojo/environment:chromium", + "//mojo/message_pump", ] mojo_sdk_deps = [ diff --git a/mojo/services/network/public/cpp/web_socket_read_queue.h b/mojo/services/network/public/cpp/web_socket_read_queue.h index 287e91c..5ba5fa5 100644 --- a/mojo/services/network/public/cpp/web_socket_read_queue.h +++ b/mojo/services/network/public/cpp/web_socket_read_queue.h @@ -8,7 +8,7 @@ #include "base/callback.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" -#include "mojo/common/handle_watcher.h" +#include "mojo/message_pump/handle_watcher.h" #include "third_party/mojo/src/mojo/public/cpp/system/data_pipe.h" namespace mojo { diff --git a/mojo/services/network/public/cpp/web_socket_write_queue.h b/mojo/services/network/public/cpp/web_socket_write_queue.h index 91e7924..d0ba6b2 100644 --- a/mojo/services/network/public/cpp/web_socket_write_queue.h +++ b/mojo/services/network/public/cpp/web_socket_write_queue.h @@ -8,7 +8,7 @@ #include "base/callback.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" -#include "mojo/common/handle_watcher.h" +#include "mojo/message_pump/handle_watcher.h" #include "third_party/mojo/src/mojo/public/cpp/system/data_pipe.h" namespace mojo { diff --git a/mojo/services/network/tcp_connected_socket_impl.h b/mojo/services/network/tcp_connected_socket_impl.h index 0327e47..b1c072e 100644 --- a/mojo/services/network/tcp_connected_socket_impl.h +++ b/mojo/services/network/tcp_connected_socket_impl.h @@ -8,7 +8,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "mojo/application/public/cpp/app_lifetime_helper.h" -#include "mojo/common/handle_watcher.h" +#include "mojo/message_pump/handle_watcher.h" #include "mojo/services/network/public/interfaces/tcp_connected_socket.mojom.h" #include "net/socket/tcp_socket.h" #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" diff --git a/mojo/services/network/url_loader_impl.h b/mojo/services/network/url_loader_impl.h index 656c615..88bf89c 100644 --- a/mojo/services/network/url_loader_impl.h +++ b/mojo/services/network/url_loader_impl.h @@ -8,7 +8,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "mojo/application/public/cpp/app_lifetime_helper.h" -#include "mojo/common/handle_watcher.h" +#include "mojo/message_pump/handle_watcher.h" #include "mojo/services/network/public/interfaces/url_loader.mojom.h" #include "net/base/net_errors.h" #include "net/url_request/url_request.h" diff --git a/mojo/services/network/url_loader_impl_apptest.cc b/mojo/services/network/url_loader_impl_apptest.cc index bab6153..777889a 100644 --- a/mojo/services/network/url_loader_impl_apptest.cc +++ b/mojo/services/network/url_loader_impl_apptest.cc @@ -8,7 +8,7 @@ #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "mojo/application/public/cpp/application_test_base.h" -#include "mojo/common/message_pump_mojo.h" +#include "mojo/message_pump/message_pump_mojo.h" #include "mojo/services/network/network_context.h" #include "mojo/services/network/url_loader_impl.h" #include "net/base/net_errors.h" diff --git a/mojo/services/network/web_socket_impl.cc b/mojo/services/network/web_socket_impl.cc index e6b89ba..fb64815 100644 --- a/mojo/services/network/web_socket_impl.cc +++ b/mojo/services/network/web_socket_impl.cc @@ -6,7 +6,7 @@ #include "base/logging.h" #include "base/message_loop/message_loop.h" -#include "mojo/common/handle_watcher.h" +#include "mojo/message_pump/handle_watcher.h" #include "mojo/services/network/network_context.h" #include "mojo/services/network/public/cpp/web_socket_read_queue.h" #include "mojo/services/network/public/cpp/web_socket_write_queue.h" |