diff options
author | rockot <rockot@chromium.org> | 2015-06-17 13:56:53 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-17 20:57:30 +0000 |
commit | d3bd2cb5bc98903bbd9788ca01c0d1e9b15536ba (patch) | |
tree | 20156b13a0d69272d39bcf05fdffc3e0307f344a /components | |
parent | 9219ddcabb17046227446df263de5ab4ee8fac3d (diff) | |
download | chromium_src-d3bd2cb5bc98903bbd9788ca01c0d1e9b15536ba.zip chromium_src-d3bd2cb5bc98903bbd9788ca01c0d1e9b15536ba.tar.gz chromium_src-d3bd2cb5bc98903bbd9788ca01c0d1e9b15536ba.tar.bz2 |
Componentize html_viewer's MessagePort
We should transition to using the same implementation in content, and this
is the first step to doing that.
BUG=361001
R=jam@chromium.org
TBR=jochen@chromium.org (+WebKit DEPS)
Review URL: https://codereview.chromium.org/1182303012
Cr-Commit-Position: refs/heads/master@{#334914}
Diffstat (limited to 'components')
-rw-r--r-- | components/components.gyp | 1 | ||||
-rw-r--r-- | components/html_viewer/BUILD.gn | 3 | ||||
-rw-r--r-- | components/html_viewer/DEPS | 1 | ||||
-rw-r--r-- | components/html_viewer/blink_platform_impl.cc | 4 | ||||
-rw-r--r-- | components/message_port.gypi | 25 | ||||
-rw-r--r-- | components/message_port/BUILD.gn | 17 | ||||
-rw-r--r-- | components/message_port/DEPS | 6 | ||||
-rw-r--r-- | components/message_port/OWNERS | 2 | ||||
-rw-r--r-- | components/message_port/web_message_port_channel_impl.cc (renamed from components/html_viewer/web_message_port_channel_impl.cc) | 6 | ||||
-rw-r--r-- | components/message_port/web_message_port_channel_impl.h (renamed from components/html_viewer/web_message_port_channel_impl.h) | 10 |
10 files changed, 63 insertions, 12 deletions
diff --git a/components/components.gyp b/components/components.gyp index 4fef48a..fa2a106 100644 --- a/components/components.gyp +++ b/components/components.gyp @@ -93,6 +93,7 @@ 'cdm.gypi', 'devtools_discovery.gypi', 'devtools_http_handler.gypi', + 'message_port.gypi', 'navigation_interception.gypi', 'power.gypi', 'safe_json_parser.gypi', diff --git a/components/html_viewer/BUILD.gn b/components/html_viewer/BUILD.gn index e03cb73..1ff16e64 100644 --- a/components/html_viewer/BUILD.gn +++ b/components/html_viewer/BUILD.gn @@ -89,8 +89,6 @@ source_set("lib") { "web_cookie_jar_impl.h", "web_layer_tree_view_impl.cc", "web_layer_tree_view_impl.h", - "web_message_port_channel_impl.cc", - "web_message_port_channel_impl.h", "web_mime_registry_impl.cc", "web_mime_registry_impl.h", "web_notification_manager_impl.cc", @@ -116,6 +114,7 @@ source_set("lib") { "//components/clipboard/public/interfaces", "//components/devtools_service/public/cpp", "//components/devtools_service/public/interfaces", + "//components/message_port", "//components/mime_util", "//components/resource_provider/public/cpp", "//components/resource_provider/public/interfaces", diff --git a/components/html_viewer/DEPS b/components/html_viewer/DEPS index 6e2d9a9..0a5b15a 100644 --- a/components/html_viewer/DEPS +++ b/components/html_viewer/DEPS @@ -6,6 +6,7 @@ include_rules = [ "+components/clipboard", "+components/devtools_service/public", "+components/gpu", + "+components/message_port", "+components/mime_util", "+components/resource_provider/public", "+components/scheduler", diff --git a/components/html_viewer/blink_platform_impl.cc b/components/html_viewer/blink_platform_impl.cc index 7c37000..e054948 100644 --- a/components/html_viewer/blink_platform_impl.cc +++ b/components/html_viewer/blink_platform_impl.cc @@ -16,9 +16,9 @@ #include "components/html_viewer/blink_resource_constants.h" #include "components/html_viewer/web_clipboard_impl.h" #include "components/html_viewer/web_cookie_jar_impl.h" -#include "components/html_viewer/web_message_port_channel_impl.h" #include "components/html_viewer/web_socket_handle_impl.h" #include "components/html_viewer/web_url_loader_impl.h" +#include "components/message_port/web_message_port_channel_impl.h" #include "components/mime_util/mime_util.h" #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" #include "components/scheduler/renderer/renderer_scheduler.h" @@ -179,7 +179,7 @@ blink::WebCompositorSupport* BlinkPlatformImpl::compositorSupport() { void BlinkPlatformImpl::createMessageChannel( blink::WebMessagePortChannel** channel1, blink::WebMessagePortChannel** channel2) { - WebMessagePortChannelImpl::CreatePair(channel1, channel2); + message_port::WebMessagePortChannelImpl::CreatePair(channel1, channel2); } blink::WebScrollbarBehavior* BlinkPlatformImpl::scrollbarBehavior() { diff --git a/components/message_port.gypi b/components/message_port.gypi new file mode 100644 index 0000000..498405e --- /dev/null +++ b/components/message_port.gypi @@ -0,0 +1,25 @@ +# Copyright 2013 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. + +{ + 'targets': [ + { + 'target_name': 'message_port', + 'type': 'static_library', + 'dependencies': [ + '../base/base.gyp:base', + '../mojo/mojo_base.gyp:mojo_common_lib', + '../third_party/WebKit/public/blink.gyp:blink', + '../third_party/mojo/mojo_public.gyp:mojo_system_cpp_headers', + ], + 'include_dirs': [ + '..', + ], + 'sources': [ + 'message_port/web_message_port_channel_impl.cc', + 'message_port/web_message_port_channel_impl.h', + ], + }, + ], +} diff --git a/components/message_port/BUILD.gn b/components/message_port/BUILD.gn new file mode 100644 index 0000000..3a81750 --- /dev/null +++ b/components/message_port/BUILD.gn @@ -0,0 +1,17 @@ +# 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. + +source_set("message_port") { + sources = [ + "web_message_port_channel_impl.cc", + "web_message_port_channel_impl.h", + ] + + public_deps = [ + "//base", + "//mojo/common", + "//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 new file mode 100644 index 0000000..eba876f --- /dev/null +++ b/components/message_port/DEPS @@ -0,0 +1,6 @@ +include_rules = [ + "+base", + "+mojo/common", + "+third_party/WebKit/public", + "+third_party/mojo/src/mojo/public/cpp/system", +] diff --git a/components/message_port/OWNERS b/components/message_port/OWNERS new file mode 100644 index 0000000..80b8751 --- /dev/null +++ b/components/message_port/OWNERS @@ -0,0 +1,2 @@ +jam@chromium.org +rockot@chromium.org diff --git a/components/html_viewer/web_message_port_channel_impl.cc b/components/message_port/web_message_port_channel_impl.cc index 45e75fc..93a6212 100644 --- a/components/html_viewer/web_message_port_channel_impl.cc +++ b/components/message_port/web_message_port_channel_impl.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 "components/html_viewer/web_message_port_channel_impl.h" +#include "components/message_port/web_message_port_channel_impl.h" #include "base/bind.h" #include "base/logging.h" @@ -16,7 +16,7 @@ using blink::WebMessagePortChannelArray; using blink::WebMessagePortChannelClient; using blink::WebString; -namespace html_viewer { +namespace message_port { void WebMessagePortChannelImpl::CreatePair( blink::WebMessagePortChannel** channel1, @@ -129,4 +129,4 @@ void WebMessagePortChannelImpl::OnMessageAvailable(MojoResult result) { WaitForNextMessage(); } -} // namespace html_viewer +} // namespace message_port diff --git a/components/html_viewer/web_message_port_channel_impl.h b/components/message_port/web_message_port_channel_impl.h index 8c723bc..49fe97e 100644 --- a/components/html_viewer/web_message_port_channel_impl.h +++ b/components/message_port/web_message_port_channel_impl.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_HTML_VIEWER_WEB_MESSAGE_PORT_CHANNEL_IMPL_H_ -#define COMPONENTS_HTML_VIEWER_WEB_MESSAGE_PORT_CHANNEL_IMPL_H_ +#ifndef COMPONENTS_MESSAGE_PORT_WEB_MESSAGE_PORT_CHANNEL_IMPL_H_ +#define COMPONENTS_MESSAGE_PORT_WEB_MESSAGE_PORT_CHANNEL_IMPL_H_ #include "base/basictypes.h" #include "mojo/common/handle_watcher.h" #include "third_party/WebKit/public/platform/WebMessagePortChannel.h" #include "third_party/mojo/src/mojo/public/cpp/system/message_pipe.h" -namespace html_viewer { +namespace message_port { class WebMessagePortChannelImpl : public blink::WebMessagePortChannel { public: @@ -40,6 +40,6 @@ class WebMessagePortChannelImpl : public blink::WebMessagePortChannel { DISALLOW_COPY_AND_ASSIGN(WebMessagePortChannelImpl); }; -} // namespace html_viewer +} // namespace message_port -#endif // COMPONENTS_HTML_VIEWER_WEB_MESSAGE_PORT_CHANNEL_IMPL_H_ +#endif // COMPONENTS_MESSAGE_PORT_WEB_MESSAGE_PORT_CHANNEL_IMPL_H_ |