Commit 6ef5c59d authored by mek's avatar mek Committed by Commit bot

Pass navigator.connect calls through to the browser process.

Depends on blink side change in https://codereview.chromium.org/782463002/
and on the blink side change in https://codereview.chromium.org/799703003/

BUG=426458

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

Cr-Commit-Position: refs/heads/master@{#308247}
parent f2891d45
// 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 "content/browser/navigator_connect/navigator_connect_dispatcher_host.h"
#include "content/browser/message_port_service.h"
#include "content/common/navigator_connect_messages.h"
#include "content/common/navigator_connect_types.h"
namespace content {
NavigatorConnectDispatcherHost::NavigatorConnectDispatcherHost()
: BrowserMessageFilter(NavigatorConnectMsgStart) {
}
NavigatorConnectDispatcherHost::~NavigatorConnectDispatcherHost() {
}
bool NavigatorConnectDispatcherHost::OnMessageReceived(
const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(NavigatorConnectDispatcherHost, message)
IPC_MESSAGE_HANDLER(NavigatorConnectHostMsg_Connect, OnConnect)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
}
void NavigatorConnectDispatcherHost::OnConnect(
int thread_id,
int request_id,
const CrossOriginServiceWorkerClient& client) {
// TODO(mek): Actually setup a connection.
// Close port since connection fails.
MessagePortService::GetInstance()->ClosePort(client.message_port_id);
Send(new NavigatorConnectMsg_ConnectResult(thread_id, request_id, false));
}
} // namespace content
// 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.
#ifndef CONTENT_BROWSER_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_DISPATCHER_HOST_H_
#define CONTENT_BROWSER_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_DISPATCHER_HOST_H_
#include "content/public/browser/browser_message_filter.h"
class GURL;
namespace content {
struct CrossOriginServiceWorkerClient;
// Receives navigator.connect connection attempts from a child process.
// Attempts to find a service that serves the URL the connection is made to
// and sets up the actual connection.
// Constructed on the UI thread, but all other methods are called on the IO
// thread. Typically there is one instance of this class for each renderer
// process, and this class lives at least as long as the renderer process is
// alive (since this class is refcounted it could outlive the renderer process
// if it is still handling a connection attempt).
class NavigatorConnectDispatcherHost : public BrowserMessageFilter {
public:
NavigatorConnectDispatcherHost();
private:
~NavigatorConnectDispatcherHost() override;
// BrowserMessageFilter implementation.
bool OnMessageReceived(const IPC::Message& message) override;
void OnConnect(int thread_id,
int request_id,
const CrossOriginServiceWorkerClient& client);
DISALLOW_COPY_AND_ASSIGN(NavigatorConnectDispatcherHost);
};
} // namespace content
#endif // CONTENT_BROWSER_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_DISPATCHER_HOST_H_
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
#include "content/browser/message_port_message_filter.h" #include "content/browser/message_port_message_filter.h"
#include "content/browser/mime_registry_message_filter.h" #include "content/browser/mime_registry_message_filter.h"
#include "content/browser/mojo/mojo_application_host.h" #include "content/browser/mojo/mojo_application_host.h"
#include "content/browser/navigator_connect/navigator_connect_dispatcher_host.h"
#include "content/browser/notifications/notification_message_filter.h" #include "content/browser/notifications/notification_message_filter.h"
#include "content/browser/permissions/permission_service_context.h" #include "content/browser/permissions/permission_service_context.h"
#include "content/browser/permissions/permission_service_impl.h" #include "content/browser/permissions/permission_service_impl.h"
...@@ -880,6 +881,7 @@ void RenderProcessHostImpl::CreateMessageFilters() { ...@@ -880,6 +881,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
#endif #endif
AddFilter(new GeofencingDispatcherHost( AddFilter(new GeofencingDispatcherHost(
storage_partition_impl_->GetGeofencingManager())); storage_partition_impl_->GetGeofencingManager()));
AddFilter(new NavigatorConnectDispatcherHost());
if (browser_command_line.HasSwitch( if (browser_command_line.HasSwitch(
switches::kEnableExperimentalWebPlatformFeatures)) switches::kEnableExperimentalWebPlatformFeatures))
AddFilter(new BluetoothDispatcherHost()); AddFilter(new BluetoothDispatcherHost());
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "content/child/child_thread.h" #include "content/child/child_thread.h"
#include "content/child/content_child_helpers.h" #include "content/child/content_child_helpers.h"
#include "content/child/geofencing/web_geofencing_provider_impl.h" #include "content/child/geofencing/web_geofencing_provider_impl.h"
#include "content/child/navigator_connect/navigator_connect_provider.h"
#include "content/child/notifications/notification_dispatcher.h" #include "content/child/notifications/notification_dispatcher.h"
#include "content/child/notifications/notification_manager.h" #include "content/child/notifications/notification_manager.h"
#include "content/child/push_messaging/push_dispatcher.h" #include "content/child/push_messaging/push_dispatcher.h"
...@@ -1080,6 +1081,15 @@ blink::WebPushProvider* BlinkPlatformImpl::pushProvider() { ...@@ -1080,6 +1081,15 @@ blink::WebPushProvider* BlinkPlatformImpl::pushProvider() {
push_dispatcher_.get()); push_dispatcher_.get());
} }
blink::WebNavigatorConnectProvider*
BlinkPlatformImpl::navigatorConnectProvider() {
if (!thread_safe_sender_.get())
return nullptr;
return NavigatorConnectProvider::ThreadSpecificInstance(
thread_safe_sender_.get(), main_thread_task_runner_);
}
WebThemeEngine* BlinkPlatformImpl::themeEngine() { WebThemeEngine* BlinkPlatformImpl::themeEngine() {
return &native_theme_engine_; return &native_theme_engine_;
} }
......
...@@ -158,6 +158,7 @@ class CONTENT_EXPORT BlinkPlatformImpl ...@@ -158,6 +158,7 @@ class CONTENT_EXPORT BlinkPlatformImpl
virtual blink::WebBluetooth* bluetooth(); virtual blink::WebBluetooth* bluetooth();
virtual blink::WebNotificationManager* notificationManager(); virtual blink::WebNotificationManager* notificationManager();
virtual blink::WebPushProvider* pushProvider(); virtual blink::WebPushProvider* pushProvider();
virtual blink::WebNavigatorConnectProvider* navigatorConnectProvider();
void SuspendSharedTimer(); void SuspendSharedTimer();
void ResumeSharedTimer(); void ResumeSharedTimer();
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "content/child/fileapi/webfilesystem_impl.h" #include "content/child/fileapi/webfilesystem_impl.h"
#include "content/child/geofencing/geofencing_message_filter.h" #include "content/child/geofencing/geofencing_message_filter.h"
#include "content/child/mojo/mojo_application.h" #include "content/child/mojo/mojo_application.h"
#include "content/child/navigator_connect/navigator_connect_dispatcher.h"
#include "content/child/notifications/notification_dispatcher.h" #include "content/child/notifications/notification_dispatcher.h"
#include "content/child/power_monitor_broadcast_source.h" #include "content/child/power_monitor_broadcast_source.h"
#include "content/child/push_messaging/push_dispatcher.h" #include "content/child/push_messaging/push_dispatcher.h"
...@@ -298,6 +299,8 @@ void ChildThread::Init(const Options& options) { ...@@ -298,6 +299,8 @@ void ChildThread::Init(const Options& options) {
notification_dispatcher_ = notification_dispatcher_ =
new NotificationDispatcher(thread_safe_sender_.get()); new NotificationDispatcher(thread_safe_sender_.get());
push_dispatcher_ = new PushDispatcher(thread_safe_sender_.get()); push_dispatcher_ = new PushDispatcher(thread_safe_sender_.get());
navigator_connect_dispatcher_ =
new NavigatorConnectDispatcher(thread_safe_sender_.get());
channel_->AddFilter(histogram_message_filter_.get()); channel_->AddFilter(histogram_message_filter_.get());
channel_->AddFilter(sync_message_filter_.get()); channel_->AddFilter(sync_message_filter_.get());
...@@ -308,6 +311,7 @@ void ChildThread::Init(const Options& options) { ...@@ -308,6 +311,7 @@ void ChildThread::Init(const Options& options) {
channel_->AddFilter(service_worker_message_filter_->GetFilter()); channel_->AddFilter(service_worker_message_filter_->GetFilter());
channel_->AddFilter(geofencing_message_filter_->GetFilter()); channel_->AddFilter(geofencing_message_filter_->GetFilter());
channel_->AddFilter(bluetooth_message_filter_->GetFilter()); channel_->AddFilter(bluetooth_message_filter_->GetFilter());
channel_->AddFilter(navigator_connect_dispatcher_->GetFilter());
if (!base::CommandLine::ForCurrentProcess()->HasSwitch( if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSingleProcess)) { switches::kSingleProcess)) {
......
...@@ -44,6 +44,7 @@ class ChildResourceMessageFilter; ...@@ -44,6 +44,7 @@ class ChildResourceMessageFilter;
class ChildSharedBitmapManager; class ChildSharedBitmapManager;
class FileSystemDispatcher; class FileSystemDispatcher;
class GeofencingMessageFilter; class GeofencingMessageFilter;
class NavigatorConnectDispatcher;
class NotificationDispatcher; class NotificationDispatcher;
class PushDispatcher; class PushDispatcher;
class ServiceWorkerMessageFilter; class ServiceWorkerMessageFilter;
...@@ -276,6 +277,8 @@ class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender { ...@@ -276,6 +277,8 @@ class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender {
scoped_refptr<BluetoothMessageFilter> bluetooth_message_filter_; scoped_refptr<BluetoothMessageFilter> bluetooth_message_filter_;
scoped_refptr<NavigatorConnectDispatcher> navigator_connect_dispatcher_;
bool in_browser_process_; bool in_browser_process_;
base::WeakPtrFactory<ChildThread> channel_connected_factory_; base::WeakPtrFactory<ChildThread> channel_connected_factory_;
......
// 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 "content/child/navigator_connect/navigator_connect_dispatcher.h"
#include "base/message_loop/message_loop_proxy.h"
#include "content/child/navigator_connect/navigator_connect_provider.h"
#include "content/child/thread_safe_sender.h"
#include "content/child/worker_thread_task_runner.h"
#include "content/common/navigator_connect_messages.h"
namespace content {
NavigatorConnectDispatcher::NavigatorConnectDispatcher(ThreadSafeSender* sender)
: main_thread_loop_proxy_(base::MessageLoopProxy::current()),
thread_safe_sender_(sender) {
}
NavigatorConnectDispatcher::~NavigatorConnectDispatcher() {
}
base::TaskRunner* NavigatorConnectDispatcher::OverrideTaskRunnerForMessage(
const IPC::Message& msg) {
if (IPC_MESSAGE_CLASS(msg) != NavigatorConnectMsgStart)
return NULL;
int ipc_thread_id = 0;
const bool success = PickleIterator(msg).ReadInt(&ipc_thread_id);
DCHECK(success);
if (!ipc_thread_id)
return main_thread_loop_proxy_.get();
return new WorkerThreadTaskRunner(ipc_thread_id);
}
bool NavigatorConnectDispatcher::OnMessageReceived(const IPC::Message& msg) {
if (IPC_MESSAGE_CLASS(msg) != NavigatorConnectMsgStart)
return false;
NavigatorConnectProvider::ThreadSpecificInstance(thread_safe_sender_.get(),
main_thread_loop_proxy_)
->OnMessageReceived(msg);
return true;
}
} // namespace content
// 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.
#ifndef CONTENT_CHILD_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_DISPATCHER_H_
#define CONTENT_CHILD_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_DISPATCHER_H_
#include "content/child/child_message_filter.h"
namespace base {
class MessageLoopProxy;
}
namespace content {
class ThreadSafeSender;
// Receives IPC messages from the browser process and dispatches them to the
// correct thread specific NavigatorConnectProvider.
class NavigatorConnectDispatcher : public ChildMessageFilter {
public:
explicit NavigatorConnectDispatcher(ThreadSafeSender* thread_safe_sender);
private:
~NavigatorConnectDispatcher() override;
// ChildMessageFilter implementation:
base::TaskRunner* OverrideTaskRunnerForMessage(
const IPC::Message& msg) override;
bool OnMessageReceived(const IPC::Message& msg) override;
scoped_refptr<base::MessageLoopProxy> main_thread_loop_proxy_;
scoped_refptr<ThreadSafeSender> thread_safe_sender_;
DISALLOW_COPY_AND_ASSIGN(NavigatorConnectDispatcher);
};
} // namespace content
#endif // CONTENT_CHILD_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_DISPATCHER_H_
// 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 "content/child/navigator_connect/navigator_connect_provider.h"
#include "base/lazy_instance.h"
#include "base/single_thread_task_runner.h"
#include "base/task_runner_util.h"
#include "content/child/thread_safe_sender.h"
#include "content/child/webmessageportchannel_impl.h"
#include "content/common/navigator_connect_messages.h"
#include "content/common/navigator_connect_types.h"
#include "third_party/WebKit/public/platform/WebCallbacks.h"
#include "third_party/WebKit/public/platform/WebURL.h"
namespace content {
namespace {
base::LazyInstance<base::ThreadLocalPointer<NavigatorConnectProvider>>::Leaky
g_provider_tls = LAZY_INSTANCE_INITIALIZER;
NavigatorConnectProvider* const kHasBeenDeleted =
reinterpret_cast<NavigatorConnectProvider*>(0x1);
int CurrentWorkerId() {
return WorkerTaskRunner::Instance()->CurrentWorkerId();
}
// Extracts the message_port_id from a message port, and queues messages for the
// port. This is a separate method since while all of this can be done on any
// thread, to get ordering right it is easiest to do both these things on the
// main thread.
int QueueMessagesAndGetMessagePortId(WebMessagePortChannelImpl* webchannel) {
int message_port_id = webchannel->message_port_id();
DCHECK(message_port_id != MSG_ROUTING_NONE);
webchannel->QueueMessages();
return message_port_id;
}
void SendConnectMessage(const scoped_refptr<ThreadSafeSender>& sender,
int thread_id,
int request_id,
const GURL& target_url,
const GURL& origin,
int message_port_id) {
sender->Send(new NavigatorConnectHostMsg_Connect(
thread_id, request_id,
CrossOriginServiceWorkerClient(target_url, origin, message_port_id)));
}
} // namespace
NavigatorConnectProvider::NavigatorConnectProvider(
ThreadSafeSender* thread_safe_sender,
const scoped_refptr<base::SingleThreadTaskRunner>& main_loop)
: thread_safe_sender_(thread_safe_sender), main_loop_(main_loop) {
g_provider_tls.Pointer()->Set(this);
}
NavigatorConnectProvider::~NavigatorConnectProvider() {
g_provider_tls.Pointer()->Set(kHasBeenDeleted);
}
void NavigatorConnectProvider::connect(
const blink::WebURL& target_url,
const blink::WebString& origin,
blink::WebMessagePortChannel* port,
blink::WebCallbacks<void, void>* callbacks) {
int request_id = requests_.Add(callbacks);
WebMessagePortChannelImpl* webchannel =
static_cast<WebMessagePortChannelImpl*>(port);
if (main_loop_->BelongsToCurrentThread()) {
SendConnectMessage(thread_safe_sender_, CurrentWorkerId(), request_id,
target_url, GURL(origin),
QueueMessagesAndGetMessagePortId(webchannel));
} else {
// WebMessagePortChannelImpl is mostly thread safe, but is only fully
// initialized after a round-trip to the main thread. This means that at
// this point the class might not be fully initialized yet. To work around
// this, call QueueMessages and extract the message_port_id on the main
// thread.
// Furthermore the last reference to WebMessagePortChannelImpl has to be
// released on the main thread as well. To ensure this happens correctly,
// it is passed using base::Unretained. Without that the closure could
// hold the last reference, which would be deleted on the wrong thread.
PostTaskAndReplyWithResult(
main_loop_.get(), FROM_HERE,
base::Bind(&QueueMessagesAndGetMessagePortId,
base::Unretained(webchannel)),
base::Bind(&SendConnectMessage, thread_safe_sender_, CurrentWorkerId(),
request_id, target_url, GURL(origin)));
}
}
void NavigatorConnectProvider::OnMessageReceived(const IPC::Message& msg) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(NavigatorConnectProvider, msg)
IPC_MESSAGE_HANDLER(NavigatorConnectMsg_ConnectResult, OnConnectResult)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
DCHECK(handled) << "Unhandled message:" << msg.type();
}
NavigatorConnectProvider* NavigatorConnectProvider::ThreadSpecificInstance(
ThreadSafeSender* thread_safe_sender,
const scoped_refptr<base::SingleThreadTaskRunner>& main_loop) {
if (g_provider_tls.Pointer()->Get() == kHasBeenDeleted) {
NOTREACHED() << "Re-instantiating TLS NavigatorConnectProvider.";
g_provider_tls.Pointer()->Set(NULL);
}
if (g_provider_tls.Pointer()->Get())
return g_provider_tls.Pointer()->Get();
NavigatorConnectProvider* provider =
new NavigatorConnectProvider(thread_safe_sender, main_loop);
if (WorkerTaskRunner::Instance()->CurrentWorkerId())
WorkerTaskRunner::Instance()->AddStopObserver(provider);
return provider;
}
void NavigatorConnectProvider::OnConnectResult(int thread_id,
int request_id,
bool allow_connect) {
ConnectCallback* callbacks = requests_.Lookup(request_id);
DCHECK(callbacks);
if (allow_connect) {
callbacks->onSuccess();
} else {
callbacks->onError();
}
requests_.Remove(request_id);
}
void NavigatorConnectProvider::OnWorkerRunLoopStopped() {
delete this;
}
} // namespace content
// 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.
#ifndef CONTENT_CHILD_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_PROVIDER_H_
#define CONTENT_CHILD_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_PROVIDER_H_
#include "base/compiler_specific.h"
#include "base/id_map.h"
#include "base/memory/ref_counted.h"
#include "content/child/worker_task_runner.h"
#include "third_party/WebKit/public/platform/WebNavigatorConnectProvider.h"
class GURL;
namespace base {
class SingleThreadTaskRunner;
}
namespace blink {
template <typename T1, typename T2>
class WebCallbacks;
class WebMessagePortChannel;
class WebString;
}
namespace IPC {
class Message;
}
namespace content {
class ThreadSafeSender;
// Main entry point for the navigator.connect API in a child process. This
// implements the blink API and passes connect calls on to the browser process.
// NavigatorConnectDispatcher receives IPCs from the browser process and passes
// them on to the correct thread specific instance of this class.
// The ThreadSpecificInstance method will return an instance of this class for
// the current thread, or create one if no instance exists yet for this thread.
// This class deletes itself if the worker thread it belongs to quits.
class NavigatorConnectProvider : public blink::WebNavigatorConnectProvider,
public WorkerTaskRunner::Observer {
public:
NavigatorConnectProvider(
ThreadSafeSender* thread_safe_sender,
const scoped_refptr<base::SingleThreadTaskRunner>& main_loop);
~NavigatorConnectProvider();
// WebNavigatorConnectProvider implementation.
virtual void connect(const blink::WebURL& target_url,
const blink::WebString& origin,
blink::WebMessagePortChannel* port,
blink::WebCallbacks<void, void>* callbacks);
void OnMessageReceived(const IPC::Message& msg);
// |thread_safe_sender| and |main_loop| need to be passed in because if the
// call leads to construction they will be needed.
static NavigatorConnectProvider* ThreadSpecificInstance(
ThreadSafeSender* thread_safe_sender,
const scoped_refptr<base::SingleThreadTaskRunner>& main_loop);
private:
void OnConnectResult(int thread_id, int request_id, bool allow_connect);
// WorkerTaskRunner::Observer implementation.
void OnWorkerRunLoopStopped() override;
scoped_refptr<ThreadSafeSender> thread_safe_sender_;
scoped_refptr<base::SingleThreadTaskRunner> main_loop_;
typedef blink::WebCallbacks<void, void> ConnectCallback;
IDMap<ConnectCallback> requests_;
DISALLOW_COPY_AND_ASSIGN(NavigatorConnectProvider);
};
} // namespace content
#endif // CONTENT_CHILD_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_PROVIDER_H_
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "content/common/message_port_messages.h" #include "content/common/message_port_messages.h"
#include "content/common/mime_registry_messages.h" #include "content/common/mime_registry_messages.h"
#include "content/common/mojo/mojo_messages.h" #include "content/common/mojo/mojo_messages.h"
#include "content/common/navigator_connect_messages.h"
#include "content/common/pepper_messages.h" #include "content/common/pepper_messages.h"
#include "content/common/platform_notification_messages.h" #include "content/common/platform_notification_messages.h"
#include "content/common/plugin_process_messages.h" #include "content/common/plugin_process_messages.h"
......
// 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.
// IPC messages for navigator.connect
#include "content/common/navigator_connect_types.h"
#include "ipc/ipc_message_macros.h"
#include "url/gurl.h"
#define IPC_MESSAGE_START NavigatorConnectMsgStart
IPC_STRUCT_TRAITS_BEGIN(content::CrossOriginServiceWorkerClient)
IPC_STRUCT_TRAITS_MEMBER(target_url)
IPC_STRUCT_TRAITS_MEMBER(origin)
IPC_STRUCT_TRAITS_MEMBER(message_port_id)
IPC_STRUCT_TRAITS_END()
// Messages sent from the child process to the browser.
IPC_MESSAGE_CONTROL3(NavigatorConnectHostMsg_Connect,
int /* thread_id */,
int /* request_id */,
content::CrossOriginServiceWorkerClient /* client */)
// Messages sent from the browser to the child process.
IPC_MESSAGE_CONTROL3(NavigatorConnectMsg_ConnectResult,
int /* thread_id */,
int /* request_id */,
bool /* allow_connect */)
// 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 "content/common/navigator_connect_types.h"
namespace content {
CrossOriginServiceWorkerClient::CrossOriginServiceWorkerClient()
: message_port_id(-1) {
}
CrossOriginServiceWorkerClient::CrossOriginServiceWorkerClient(
const GURL& target_url,
const GURL& origin,
int message_port_id)
: target_url(target_url), origin(origin), message_port_id(message_port_id) {
}
CrossOriginServiceWorkerClient::~CrossOriginServiceWorkerClient() {
}
} // namespace content
// 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.
#ifndef CONTENT_COMMON_NAVIGATOR_CONNECT_TYPES_H_
#define CONTENT_COMMON_NAVIGATOR_CONNECT_TYPES_H_
#include "url/gurl.h"
// This file is to have common definitions that are to be shared by
// browser and child process.
namespace content {
struct CrossOriginServiceWorkerClient {
CrossOriginServiceWorkerClient();
CrossOriginServiceWorkerClient(const GURL& target_url,
const GURL& origin,
int message_port_id);
~CrossOriginServiceWorkerClient();
GURL target_url;
GURL origin;
int message_port_id;
};
} // namespace content
#endif // CONTENT_COMMON_NAVIGATOR_CONNECT_TYPES_H_
...@@ -930,6 +930,8 @@ ...@@ -930,6 +930,8 @@
'browser/mojo/mojo_application_host.h', 'browser/mojo/mojo_application_host.h',
'browser/mojo/service_registry_android.cc', 'browser/mojo/service_registry_android.cc',
'browser/mojo/service_registry_android.h', 'browser/mojo/service_registry_android.h',
'browser/navigator_connect/navigator_connect_dispatcher_host.cc',
'browser/navigator_connect/navigator_connect_dispatcher_host.h',
'browser/net/browser_online_state_observer.cc', 'browser/net/browser_online_state_observer.cc',
'browser/net/browser_online_state_observer.h', 'browser/net/browser_online_state_observer.h',
'browser/net/sqlite_persistent_cookie_store.cc', 'browser/net/sqlite_persistent_cookie_store.cc',
......
...@@ -105,6 +105,10 @@ ...@@ -105,6 +105,10 @@
'child/mojo/mojo_application.h', 'child/mojo/mojo_application.h',
'child/multipart_response_delegate.cc', 'child/multipart_response_delegate.cc',
'child/multipart_response_delegate.h', 'child/multipart_response_delegate.h',
'child/navigator_connect/navigator_connect_dispatcher.cc',
'child/navigator_connect/navigator_connect_dispatcher.h',
'child/navigator_connect/navigator_connect_provider.cc',
'child/navigator_connect/navigator_connect_provider.h',
'child/notifications/notification_data_conversions.cc', 'child/notifications/notification_data_conversions.cc',
'child/notifications/notification_data_conversions.h', 'child/notifications/notification_data_conversions.h',
'child/notifications/notification_dispatcher.cc', 'child/notifications/notification_dispatcher.cc',
......
...@@ -412,6 +412,9 @@ ...@@ -412,6 +412,9 @@
'common/navigation_gesture.h', 'common/navigation_gesture.h',
'common/navigation_params.cc', 'common/navigation_params.cc',
'common/navigation_params.h', 'common/navigation_params.h',
'common/navigator_connect_messages.h',
'common/navigator_connect_types.cc',
'common/navigator_connect_types.h',
'common/net/url_fetcher.cc', 'common/net/url_fetcher.cc',
'common/net/url_request_user_data.cc', 'common/net/url_request_user_data.cc',
'common/net/url_request_user_data.h', 'common/net/url_request_user_data.h',
......
...@@ -114,6 +114,7 @@ enum IPCMessageStart { ...@@ -114,6 +114,7 @@ enum IPCMessageStart {
LayoutTestMsgStart, LayoutTestMsgStart,
DnsPrefetchMsgStart, DnsPrefetchMsgStart,
BluetoothMsgStart, BluetoothMsgStart,
NavigatorConnectMsgStart,
LastIPCMsgStart // Must come last. LastIPCMsgStart // Must come last.
}; };
......
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