diff options
32 files changed, 66 insertions, 110 deletions
diff --git a/chrome/browser/task_management/providers/child_process_task.cc b/chrome/browser/task_management/providers/child_process_task.cc index f0e3b60..b5a8cb7 100644 --- a/chrome/browser/task_management/providers/child_process_task.cc +++ b/chrome/browser/task_management/providers/child_process_task.cc @@ -113,7 +113,7 @@ void ConnectResourceReporterOnIOThread( // |unique_child_process_id|. ProcessResourceUsage* CreateProcessResourcesSampler( int unique_child_process_id) { - ResourceUsageReporterPtr service(4); + ResourceUsageReporterPtr service; mojo::InterfaceRequest<ResourceUsageReporter> usage_reporter = mojo::GetProxy(&service); diff --git a/chrome/browser/task_management/providers/web_contents/renderer_task.cc b/chrome/browser/task_management/providers/web_contents/renderer_task.cc index c5bde58..ca30ac7 100644 --- a/chrome/browser/task_management/providers/web_contents/renderer_task.cc +++ b/chrome/browser/task_management/providers/web_contents/renderer_task.cc @@ -30,7 +30,7 @@ namespace { // |render_process_host|. ProcessResourceUsage* CreateRendererResourcesSampler( content::RenderProcessHost* render_process_host) { - ResourceUsageReporterPtr service(3); + ResourceUsageReporterPtr service; content::ServiceRegistry* service_registry = render_process_host->GetServiceRegistry(); if (service_registry) diff --git a/chrome/browser/task_manager/renderer_resource.cc b/chrome/browser/task_manager/renderer_resource.cc index 50e4586..51f0dc1 100644 --- a/chrome/browser/task_manager/renderer_resource.cc +++ b/chrome/browser/task_manager/renderer_resource.cc @@ -22,7 +22,7 @@ RendererResource::RendererResource(base::ProcessHandle process, // We cache the process and pid as when a Tab/BackgroundContents is closed the // process reference becomes NULL and the TaskManager still needs it. unique_process_id_ = render_view_host_->GetProcess()->GetID(); - ResourceUsageReporterPtr service(5); + ResourceUsageReporterPtr service; content::ServiceRegistry* service_registry = render_view_host_->GetProcess()->GetServiceRegistry(); if (service_registry) diff --git a/chrome/renderer/chrome_render_process_observer.cc b/chrome/renderer/chrome_render_process_observer.cc index 2dc903d..f6455ff 100644 --- a/chrome/renderer/chrome_render_process_observer.cc +++ b/chrome/renderer/chrome_render_process_observer.cc @@ -121,11 +121,10 @@ static const int kWaitForWorkersStatsTimeoutMS = 20; class ResourceUsageReporterImpl : public ResourceUsageReporter { public: - ResourceUsageReporterImpl(base::WeakPtr<ChromeRenderProcessObserver> observer, - mojo::InterfaceRequest<ResourceUsageReporter> req) - : binding_(this, req.Pass(), 31), - observer_(observer), - weak_factory_(this) {} + ResourceUsageReporterImpl( + base::WeakPtr<ChromeRenderProcessObserver> observer, + mojo::InterfaceRequest<ResourceUsageReporter> req) + : binding_(this, req.Pass()), observer_(observer), weak_factory_(this) {} ~ResourceUsageReporterImpl() override {} private: diff --git a/components/dom_distiller/content/renderer/distiller_native_javascript.cc b/components/dom_distiller/content/renderer/distiller_native_javascript.cc index 4be0371..02a14dd 100644 --- a/components/dom_distiller/content/renderer/distiller_native_javascript.cc +++ b/components/dom_distiller/content/renderer/distiller_native_javascript.cc @@ -23,7 +23,7 @@ namespace dom_distiller { DistillerNativeJavaScript::DistillerNativeJavaScript( content::RenderFrame* render_frame) - : render_frame_(render_frame), distiller_js_service_(2) {} + : render_frame_(render_frame) {} DistillerNativeJavaScript::~DistillerNativeJavaScript() {} diff --git a/components/dom_distiller/content/renderer/distiller_page_notifier_service_impl.cc b/components/dom_distiller/content/renderer/distiller_page_notifier_service_impl.cc index ac79fd2..7ff1e72 100644 --- a/components/dom_distiller/content/renderer/distiller_page_notifier_service_impl.cc +++ b/components/dom_distiller/content/renderer/distiller_page_notifier_service_impl.cc @@ -12,7 +12,8 @@ namespace dom_distiller { DistillerPageNotifierServiceImpl::DistillerPageNotifierServiceImpl( DistillerJsRenderFrameObserver* observer, mojo::InterfaceRequest<DistillerPageNotifierService> request) - : binding_(this, request.Pass(), 34), distiller_js_observer_(observer) {} + : binding_(this, request.Pass()), + distiller_js_observer_(observer) {} void DistillerPageNotifierServiceImpl::NotifyIsDistillerPage() { // TODO(mdjones): Send some form of unique ID so this call knows diff --git a/content/child/background_sync/background_sync_provider.cc b/content/child/background_sync/background_sync_provider.cc index bbf4ee4..57f3d56 100644 --- a/content/child/background_sync/background_sync_provider.cc +++ b/content/child/background_sync/background_sync_provider.cc @@ -30,7 +30,7 @@ int64 GetServiceWorkerRegistrationId( BackgroundSyncProvider::BackgroundSyncProvider( ServiceRegistry* service_registry) - : service_registry_(service_registry), background_sync_service_(14) { + : service_registry_(service_registry) { DCHECK(service_registry); } diff --git a/content/child/mojo/mojo_application.cc b/content/child/mojo/mojo_application.cc index 1134755..fc2e989 100644 --- a/content/child/mojo/mojo_application.cc +++ b/content/child/mojo/mojo_application.cc @@ -43,13 +43,13 @@ void MojoApplication::OnActivate( channel_init_.Init(handle, io_task_runner_); DCHECK(message_pipe.is_valid()); - ApplicationSetupPtr application_setup(25); + ApplicationSetupPtr application_setup; application_setup.Bind( mojo::InterfacePtrInfo<ApplicationSetup>(message_pipe.Pass(), 0u)); - mojo::ServiceProviderPtr services(26); + mojo::ServiceProviderPtr services; mojo::ServiceProviderPtr exposed_services; - service_registry_.Bind(GetProxy(&exposed_services), 27); + service_registry_.Bind(GetProxy(&exposed_services)); application_setup->ExchangeServiceProviders(GetProxy(&services), exposed_services.Pass()); service_registry_.BindRemoteServiceProvider(services.Pass()); diff --git a/content/child/navigator_connect/service_port_dispatcher_impl.cc b/content/child/navigator_connect/service_port_dispatcher_impl.cc index 239158d..977f2b9 100644 --- a/content/child/navigator_connect/service_port_dispatcher_impl.cc +++ b/content/child/navigator_connect/service_port_dispatcher_impl.cc @@ -52,7 +52,7 @@ ServicePortDispatcherImpl::~ServicePortDispatcherImpl() { ServicePortDispatcherImpl::ServicePortDispatcherImpl( base::WeakPtr<blink::WebServiceWorkerContextProxy> proxy, mojo::InterfaceRequest<ServicePortDispatcher> request) - : binding_(this, request.Pass(), 32), proxy_(proxy) { + : binding_(this, request.Pass()), proxy_(proxy) { WorkerThread::AddObserver(this); } diff --git a/content/child/navigator_connect/service_port_provider.cc b/content/child/navigator_connect/service_port_provider.cc index d97ab87..c66a748 100644 --- a/content/child/navigator_connect/service_port_provider.cc +++ b/content/child/navigator_connect/service_port_provider.cc @@ -31,10 +31,7 @@ void ConnectToServiceOnMainThread( ServicePortProvider::ServicePortProvider( blink::WebServicePortProviderClient* client, const scoped_refptr<base::SingleThreadTaskRunner>& main_loop) - : client_(client), - binding_(this), - service_port_service_(29), - main_loop_(main_loop) { + : client_(client), binding_(this), main_loop_(main_loop) { DCHECK(client_); AddRef(); } @@ -126,7 +123,7 @@ ServicePortServicePtr& ServicePortProvider::GetServicePortServicePtr() { // Setup channel for browser to post events back to this class. ServicePortServiceClientPtr client_ptr; - binding_.Bind(GetProxy(&client_ptr), 30); + binding_.Bind(GetProxy(&client_ptr)); service_port_service_->SetClient(client_ptr.Pass()); } return service_port_service_; diff --git a/content/common/mojo/service_registry_impl.cc b/content/common/mojo/service_registry_impl.cc index 0bbbf10..38283ac 100644 --- a/content/common/mojo/service_registry_impl.cc +++ b/content/common/mojo/service_registry_impl.cc @@ -23,9 +23,8 @@ ServiceRegistryImpl::~ServiceRegistryImpl() { } void ServiceRegistryImpl::Bind( - mojo::InterfaceRequest<mojo::ServiceProvider> request, - int id) { - binding_.Bind(request.Pass(), id); + mojo::InterfaceRequest<mojo::ServiceProvider> request) { + binding_.Bind(request.Pass()); } void ServiceRegistryImpl::BindRemoteServiceProvider( diff --git a/content/common/mojo/service_registry_impl.h b/content/common/mojo/service_registry_impl.h index 59d978d..b25ade9 100644 --- a/content/common/mojo/service_registry_impl.h +++ b/content/common/mojo/service_registry_impl.h @@ -28,8 +28,7 @@ class CONTENT_EXPORT ServiceRegistryImpl ~ServiceRegistryImpl() override; // Binds this ServiceProvider implementation to a message pipe endpoint. - // TODO(rockot): Remove the id argument once http://crbug.com/534719 is fixed. - void Bind(mojo::InterfaceRequest<mojo::ServiceProvider> request, int id = 0); + void Bind(mojo::InterfaceRequest<mojo::ServiceProvider> request); // Binds to a remote ServiceProvider. This will expose added services to the // remote ServiceProvider with the corresponding handle and enable diff --git a/content/renderer/background_sync/background_sync_client_impl.cc b/content/renderer/background_sync/background_sync_client_impl.cc index d19bcfb..9ba8af3 100644 --- a/content/renderer/background_sync/background_sync_client_impl.cc +++ b/content/renderer/background_sync/background_sync_client_impl.cc @@ -27,7 +27,7 @@ BackgroundSyncClientImpl::BackgroundSyncClientImpl( int64 service_worker_registration_id, mojo::InterfaceRequest<BackgroundSyncServiceClient> request) : service_worker_registration_id_(service_worker_registration_id), - binding_(this, request.Pass(), 13), + binding_(this, request.Pass()), callback_seq_num_(0) {} void BackgroundSyncClientImpl::Sync(int64_t handle_id, diff --git a/content/renderer/battery_status/battery_status_dispatcher.cc b/content/renderer/battery_status/battery_status_dispatcher.cc index 5fc3217..1034cb3 100644 --- a/content/renderer/battery_status/battery_status_dispatcher.cc +++ b/content/renderer/battery_status/battery_status_dispatcher.cc @@ -12,7 +12,7 @@ namespace content { BatteryStatusDispatcher::BatteryStatusDispatcher( blink::WebBatteryStatusListener* listener) - : monitor_(18), listener_(listener) { + : listener_(listener) { DCHECK(listener_); if (ServiceRegistry* registry = RenderThread::Get()->GetServiceRegistry()) { diff --git a/content/renderer/geolocation_dispatcher.cc b/content/renderer/geolocation_dispatcher.cc index 2c9f93d..9f54473 100644 --- a/content/renderer/geolocation_dispatcher.cc +++ b/content/renderer/geolocation_dispatcher.cc @@ -25,9 +25,8 @@ namespace content { GeolocationDispatcher::GeolocationDispatcher(RenderFrame* render_frame) : RenderFrameObserver(render_frame), pending_permissions_(new WebGeolocationPermissionRequestManager()), - geolocation_service_(11), - enable_high_accuracy_(false), - permission_service_(12) {} + enable_high_accuracy_(false) { +} GeolocationDispatcher::~GeolocationDispatcher() {} diff --git a/content/renderer/presentation/presentation_dispatcher.cc b/content/renderer/presentation/presentation_dispatcher.cc index 3be9a42..a2c7bc8 100644 --- a/content/renderer/presentation/presentation_dispatcher.cc +++ b/content/renderer/presentation/presentation_dispatcher.cc @@ -58,8 +58,8 @@ namespace content { PresentationDispatcher::PresentationDispatcher(RenderFrame* render_frame) : RenderFrameObserver(render_frame), controller_(nullptr), - presentation_service_(15), - binding_(this) {} + binding_(this) { +} PresentationDispatcher::~PresentationDispatcher() { // Controller should be destroyed before the dispatcher when frame is @@ -421,7 +421,7 @@ void PresentationDispatcher::ConnectToPresentationServiceIfNeeded() { render_frame()->GetServiceRegistry()->ConnectToRemoteService( mojo::GetProxy(&presentation_service_)); presentation::PresentationServiceClientPtr client_ptr; - binding_.Bind(GetProxy(&client_ptr), 16); + binding_.Bind(GetProxy(&client_ptr)); presentation_service_->SetClient(client_ptr.Pass()); presentation_service_->ListenForDefaultSessionStart(base::Bind( diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 7803741..1f4768b 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc @@ -1175,7 +1175,7 @@ void RenderFrameImpl::NavigateToSwappedOutURL() { void RenderFrameImpl::BindServiceRegistry( mojo::InterfaceRequest<mojo::ServiceProvider> services, mojo::ServiceProviderPtr exposed_services) { - service_registry_.Bind(services.Pass(), 20); + service_registry_.Bind(services.Pass()); service_registry_.BindRemoteServiceProvider(exposed_services.Pass()); } @@ -5194,7 +5194,7 @@ void RenderFrameImpl::RegisterMojoServices() { mojo::ServiceProviderPtr RenderFrameImpl::ConnectToApplication( const GURL& url) { DCHECK(mojo_shell_); - mojo::ServiceProviderPtr service_provider(21); + mojo::ServiceProviderPtr service_provider; mojo::URLRequestPtr request(mojo::URLRequest::New()); request->url = mojo::String::From(url); mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index 8f37464..c24ed13 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -344,7 +344,7 @@ class RenderFrameSetupImpl : public RenderFrameSetup { public: explicit RenderFrameSetupImpl( mojo::InterfaceRequest<RenderFrameSetup> request) - : routing_id_highmark_(-1), binding_(this, request.Pass(), 24) {} + : routing_id_highmark_(-1), binding_(this, request.Pass()) {} void ExchangeServiceProviders( int32_t frame_routing_id, @@ -361,17 +361,12 @@ class RenderFrameSetupImpl : public RenderFrameSetup { // created due to a race between the message and a ViewMsg_New IPC that // triggers creation of the RenderFrame we want. if (!frame) { - mojo::ServiceProviderPtr exposed_services_with_id(22); - exposed_services_with_id.Bind(exposed_services.PassInterface()); RenderThreadImpl::current()->RegisterPendingRenderFrameConnect( - frame_routing_id, services.Pass(), exposed_services_with_id.Pass()); + frame_routing_id, services.Pass(), exposed_services.Pass()); return; } - mojo::ServiceProviderPtr exposed_services_with_id(23); - exposed_services_with_id.Bind(exposed_services.PassInterface()); - frame->BindServiceRegistry(services.Pass(), - exposed_services_with_id.Pass()); + frame->BindServiceRegistry(services.Pass(), exposed_services.Pass()); } private: @@ -411,7 +406,7 @@ class EmbeddedWorkerSetupImpl : public EmbeddedWorkerSetup { public: explicit EmbeddedWorkerSetupImpl( mojo::InterfaceRequest<EmbeddedWorkerSetup> request) - : binding_(this, request.Pass(), 33) {} + : binding_(this, request.Pass()) {} void ExchangeServiceProviders( int32_t thread_id, diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc index f366df6..9da0779 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc @@ -240,8 +240,7 @@ RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( plugin_refresh_allowed_(true), default_task_runner_(renderer_scheduler->DefaultTaskRunner()), loading_task_runner_(renderer_scheduler->LoadingTaskRunner()), - web_scrollbar_behavior_(new WebScrollbarBehaviorImpl), - vibration_manager_(6) { + web_scrollbar_behavior_(new WebScrollbarBehaviorImpl) { #if !defined(OS_ANDROID) && !defined(OS_WIN) if (g_sandbox_enabled && sandboxEnabled()) { sandbox_support_.reset(new RendererBlinkPlatformImpl::SandboxSupport); diff --git a/content/renderer/service_worker/service_worker_context_client.cc b/content/renderer/service_worker/service_worker_context_client.cc index 34e1731..7dfe599 100644 --- a/content/renderer/service_worker/service_worker_context_client.cc +++ b/content/renderer/service_worker/service_worker_context_client.cc @@ -279,7 +279,7 @@ void ServiceWorkerContextClient::OnMessageReceived( void ServiceWorkerContextClient::BindServiceRegistry( mojo::InterfaceRequest<mojo::ServiceProvider> services, mojo::ServiceProviderPtr exposed_services) { - context_->service_registry.Bind(services.Pass(), 19); + context_->service_registry.Bind(services.Pass()); context_->service_registry.BindRemoteServiceProvider(exposed_services.Pass()); } diff --git a/content/renderer/usb/web_usb_client_impl.cc b/content/renderer/usb/web_usb_client_impl.cc index 6915e08..43e7b62 100644 --- a/content/renderer/usb/web_usb_client_impl.cc +++ b/content/renderer/usb/web_usb_client_impl.cc @@ -56,7 +56,7 @@ void OnGetDevicesComplete( blink::WebVector<blink::WebUSBDevice*>* devices = new blink::WebVector<blink::WebUSBDevice*>(results.size()); for (size_t i = 0; i < results.size(); ++i) { - device::usb::DevicePtr device(8); + device::usb::DevicePtr device; device_manager->GetDevice(results[i]->guid, mojo::GetProxy(&device)); (*devices)[i] = new WebUSBDeviceImpl( device.Pass(), mojo::ConvertTo<blink::WebUSBDeviceInfo>(results[i])); @@ -66,8 +66,7 @@ void OnGetDevicesComplete( } // namespace -WebUSBClientImpl::WebUSBClientImpl(content::ServiceRegistry* service_registry) - : device_manager_(7) { +WebUSBClientImpl::WebUSBClientImpl(content::ServiceRegistry* service_registry) { service_registry->ConnectToRemoteService(mojo::GetProxy(&device_manager_)); } @@ -112,7 +111,7 @@ void WebUSBClientImpl::OnDeviceChangeNotification( for (size_t i = 0; i < notification->devices_added.size(); ++i) { const device::usb::DeviceInfoPtr& device_info = notification->devices_added[i]; - device::usb::DevicePtr device(9); + device::usb::DevicePtr device; device_manager_->GetDevice(device_info->guid, mojo::GetProxy(&device)); observer_->onDeviceConnected(blink::adoptWebPtr(new WebUSBDeviceImpl( device.Pass(), mojo::ConvertTo<blink::WebUSBDeviceInfo>(device_info)))); @@ -120,7 +119,7 @@ void WebUSBClientImpl::OnDeviceChangeNotification( for (size_t i = 0; i < notification->devices_removed.size(); ++i) { const device::usb::DeviceInfoPtr& device_info = notification->devices_removed[i]; - device::usb::DevicePtr device(10); + device::usb::DevicePtr device; device_manager_->GetDevice(device_info->guid, mojo::GetProxy(&device)); observer_->onDeviceDisconnected(blink::adoptWebPtr(new WebUSBDeviceImpl( device.Pass(), mojo::ConvertTo<blink::WebUSBDeviceInfo>(device_info)))); diff --git a/content/renderer/vr/vr_dispatcher.cc b/content/renderer/vr/vr_dispatcher.cc index ac4981a..a797713 100644 --- a/content/renderer/vr/vr_dispatcher.cc +++ b/content/renderer/vr/vr_dispatcher.cc @@ -10,7 +10,8 @@ namespace content { VRDispatcher::VRDispatcher(ServiceRegistry* service_registry) - : service_registry_(service_registry), vr_service_(17) {} + : service_registry_(service_registry) { +} VRDispatcher::~VRDispatcher() { } diff --git a/ipc/mojo/ipc_channel_mojo.cc b/ipc/mojo/ipc_channel_mojo.cc index 7b91f72..22f1ca5 100644 --- a/ipc/mojo/ipc_channel_mojo.cc +++ b/ipc/mojo/ipc_channel_mojo.cc @@ -95,7 +95,7 @@ class ClientChannelMojo : public ChannelMojo, public ClientChannel { private: void BindPipe(mojo::ScopedMessagePipeHandle handle) { - binding_.Bind(handle.Pass(), 1); + binding_.Bind(handle.Pass()); } void OnConnectionError() { listener()->OnChannelError(); diff --git a/mojo/gles2/command_buffer_client_impl.cc b/mojo/gles2/command_buffer_client_impl.cc index ba16771..d642953 100644 --- a/mojo/gles2/command_buffer_client_impl.cc +++ b/mojo/gles2/command_buffer_client_impl.cc @@ -161,7 +161,7 @@ bool CommandBufferClientImpl::Initialize() { new SyncPointClientImpl(&sync_point_client, async_waiter_)); mojo::CommandBufferLostContextObserverPtr observer_ptr; - observer_binding_.Bind(GetProxy(&observer_ptr), 0, async_waiter_); + observer_binding_.Bind(GetProxy(&observer_ptr), async_waiter_); command_buffer_->Initialize(sync_client.Pass(), sync_point_client.Pass(), observer_ptr.Pass(), diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/binding.h b/third_party/mojo/src/mojo/public/cpp/bindings/binding.h index d646c66..de9159f 100644 --- a/third_party/mojo/src/mojo/public/cpp/bindings/binding.h +++ b/third_party/mojo/src/mojo/public/cpp/bindings/binding.h @@ -69,10 +69,9 @@ class Binding { // See class comment for definition of |waiter|. Binding(Interface* impl, ScopedMessagePipeHandle handle, - int id = 0, const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) : Binding(impl) { - Bind(handle.Pass(), id, waiter); + Bind(handle.Pass(), waiter); } // Constructs a completed binding of |impl| to a new message pipe, passing the @@ -85,7 +84,7 @@ class Binding { InterfacePtr<Interface>* ptr, const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) : Binding(impl) { - Bind(ptr, 0, waiter); + Bind(ptr, waiter); } // Constructs a completed binding of |impl| to the message pipe endpoint in @@ -94,10 +93,9 @@ class Binding { // |waiter|. Binding(Interface* impl, InterfaceRequest<Interface> request, - int id = 0, const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) : Binding(impl) { - Bind(request.PassMessagePipe(), id, waiter); + Bind(request.PassMessagePipe(), waiter); } // Tears down the binding, closing the message pipe and leaving the interface @@ -112,7 +110,6 @@ class Binding { // specified implementation. See class comment for definition of |waiter|. void Bind( ScopedMessagePipeHandle handle, - int id = 0, const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) { MOJO_DCHECK(!internal_router_); internal::FilterChain filters; @@ -120,7 +117,7 @@ class Binding { filters.Append<typename Interface::RequestValidator_>(); internal_router_ = - new internal::Router(handle.Pass(), filters.Pass(), id, waiter); + new internal::Router(handle.Pass(), filters.Pass(), waiter); internal_router_->set_incoming_receiver(&stub_); internal_router_->set_connection_error_handler( [this]() { connection_error_handler_.Run(); }); @@ -134,13 +131,12 @@ class Binding { // class comment for definition of |waiter|. void Bind( InterfacePtr<Interface>* ptr, - int id = 0, const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) { MessagePipe pipe; ptr->Bind( InterfacePtrInfo<Interface>(pipe.handle0.Pass(), Interface::Version_), waiter); - Bind(pipe.handle1.Pass(), id, waiter); + Bind(pipe.handle1.Pass(), waiter); } // Completes a binding that was constructed with only an interface @@ -149,9 +145,8 @@ class Binding { // for definition of |waiter|. void Bind( InterfaceRequest<Interface> request, - int id = 0, const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) { - Bind(request.PassMessagePipe(), id, waiter); + Bind(request.PassMessagePipe(), waiter); } // Stops processing incoming messages until diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h b/third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h index a5c8800..dc44667 100644 --- a/third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h +++ b/third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h @@ -31,12 +31,11 @@ class InterfacePtr { MOJO_MOVE_ONLY_TYPE(InterfacePtr) public: // Constructs an unbound InterfacePtr. - InterfacePtr(int id = 0) : internal_state_(id) {} - InterfacePtr(decltype(nullptr), int id = 0) : internal_state_(id) {} + InterfacePtr() {} + InterfacePtr(decltype(nullptr)) {} // Takes over the binding of another InterfacePtr. - InterfacePtr(InterfacePtr&& other) - : internal_state_(other.internal_state_.id()) { + InterfacePtr(InterfacePtr&& other) { internal_state_.Swap(&other.internal_state_); } @@ -44,7 +43,6 @@ class InterfacePtr { // already bound to this pointer. InterfacePtr& operator=(InterfacePtr&& other) { reset(); - internal_state_.set_id(other.internal_state_.id()); internal_state_.Swap(&other.internal_state_); return *this; } @@ -110,7 +108,7 @@ class InterfacePtr { // Closes the bound message pipe (if any) and returns the pointer to the // unbound state. void reset() { - State doomed(-1); + State doomed; internal_state_.Swap(&doomed); } @@ -147,7 +145,7 @@ class InterfacePtr { // pending response. InterfacePtrInfo<Interface> PassInterface() { MOJO_DCHECK(!internal_state_.has_pending_callbacks()); - State state(-1); + State state; internal_state_.Swap(&state); return state.PassInterface(); diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/lib/connector.cc b/third_party/mojo/src/mojo/public/cpp/bindings/lib/connector.cc index 2c63e4f..7c92ac3 100644 --- a/third_party/mojo/src/mojo/public/cpp/bindings/lib/connector.cc +++ b/third_party/mojo/src/mojo/public/cpp/bindings/lib/connector.cc @@ -12,10 +12,8 @@ namespace internal { // ---------------------------------------------------------------------------- Connector::Connector(ScopedMessagePipeHandle message_pipe, - int id, const MojoAsyncWaiter* waiter) - : id_(id), - waiter_(waiter), + : waiter_(waiter), message_pipe_(message_pipe.Pass()), incoming_receiver_(nullptr), async_wait_id_(0), @@ -153,7 +151,7 @@ void Connector::OnHandleReady(MojoResult result) { void Connector::WaitToReadMore() { MOJO_CHECK(!async_wait_id_); async_wait_id_ = waiter_->AsyncWait( - 1000 + id_, message_pipe_.get().value(), MOJO_HANDLE_SIGNAL_READABLE, + 4, message_pipe_.get().value(), MOJO_HANDLE_SIGNAL_READABLE, MOJO_DEADLINE_INDEFINITE, &Connector::CallOnHandleReady, this); } diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/lib/connector.h b/third_party/mojo/src/mojo/public/cpp/bindings/lib/connector.h index f8f8251..02bbfa4 100644 --- a/third_party/mojo/src/mojo/public/cpp/bindings/lib/connector.h +++ b/third_party/mojo/src/mojo/public/cpp/bindings/lib/connector.h @@ -28,7 +28,6 @@ class Connector : public MessageReceiver { // The Connector takes ownership of |message_pipe|. explicit Connector( ScopedMessagePipeHandle message_pipe, - int id = 0, const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()); ~Connector() override; @@ -98,10 +97,6 @@ class Connector : public MessageReceiver { // Cancels any calls made to |waiter_|. void CancelWait(); - // TODO(rockot): Remove this once we've resolved http://crbug.com/534719. - // This is used to help identify binding and proxy creation sites. - int id_; - Closure connection_error_handler_; const MojoAsyncWaiter* waiter_; diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/lib/interface_ptr_internal.h b/third_party/mojo/src/mojo/public/cpp/bindings/lib/interface_ptr_internal.h index 1307923..1c2cad8 100644 --- a/third_party/mojo/src/mojo/public/cpp/bindings/lib/interface_ptr_internal.h +++ b/third_party/mojo/src/mojo/public/cpp/bindings/lib/interface_ptr_internal.h @@ -23,12 +23,8 @@ namespace internal { template <typename Interface> class InterfacePtrState { public: - InterfacePtrState(int id) - : proxy_(nullptr), - router_(nullptr), - waiter_(nullptr), - version_(0u), - id_(id) {} + InterfacePtrState() + : proxy_(nullptr), router_(nullptr), waiter_(nullptr), version_(0u) {} ~InterfacePtrState() { // Destruction order matters here. We delete |proxy_| first, even though @@ -47,9 +43,6 @@ class InterfacePtrState { uint32_t version() const { return version_; } - void set_id(int id) { id_ = id; } - int id() const { return id_; } - void QueryVersion(const Callback<void(uint32_t)>& callback) { ConfigureProxyIfNecessary(); @@ -155,7 +148,7 @@ class InterfacePtrState { filters.Append<MessageHeaderValidator>(); filters.Append<typename Interface::ResponseValidator_>(); - router_ = new Router(handle_.Pass(), filters.Pass(), id_, waiter_); + router_ = new Router(handle_.Pass(), filters.Pass(), waiter_); waiter_ = nullptr; proxy_ = new Proxy(router_); @@ -172,9 +165,6 @@ class InterfacePtrState { uint32_t version_; - // TODO(rockot): Remove this once we've resolved http://crbug.com/534719. - int id_; - MOJO_DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); }; diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.cc b/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.cc index 1e81c39..5a7c7e2 100644 --- a/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.cc +++ b/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.cc @@ -72,11 +72,10 @@ bool Router::HandleIncomingMessageThunk::Accept(Message* message) { Router::Router(ScopedMessagePipeHandle message_pipe, FilterChain filters, - int id, const MojoAsyncWaiter* waiter) : thunk_(this), filters_(filters.Pass()), - connector_(message_pipe.Pass(), id, waiter), + connector_(message_pipe.Pass(), waiter), weak_self_(this), incoming_receiver_(nullptr), next_request_id_(0), diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.h b/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.h index faa7ba5..d7e5a68 100644 --- a/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.h +++ b/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.h @@ -20,7 +20,6 @@ class Router : public MessageReceiverWithResponder { public: Router(ScopedMessagePipeHandle message_pipe, FilterChain filters, - int id = 0, const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()); ~Router() override; diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h b/third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h index 472b081..860260e 100644 --- a/third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h +++ b/third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h @@ -55,54 +55,48 @@ class StrongBinding { StrongBinding( Interface* impl, ScopedMessagePipeHandle handle, - int id = 0, const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) : StrongBinding(impl) { - binding_.Bind(handle.Pass(), id, waiter); + binding_.Bind(handle.Pass(), waiter); } StrongBinding( Interface* impl, InterfacePtr<Interface>* ptr, - int id = 0, const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) : StrongBinding(impl) { - binding_.Bind(ptr, id, waiter); + binding_.Bind(ptr, waiter); } StrongBinding( Interface* impl, InterfaceRequest<Interface> request, - int id = 0, const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) : StrongBinding(impl) { - binding_.Bind(request.Pass(), id, waiter); + binding_.Bind(request.Pass(), waiter); } ~StrongBinding() {} void Bind( ScopedMessagePipeHandle handle, - int id = 0, const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) { assert(!binding_.is_bound()); - binding_.Bind(handle.Pass(), id, waiter); + binding_.Bind(handle.Pass(), waiter); } void Bind( InterfacePtr<Interface>* ptr, - int id = 0, const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) { assert(!binding_.is_bound()); - binding_.Bind(ptr, id, waiter); + binding_.Bind(ptr, waiter); } void Bind( InterfaceRequest<Interface> request, - int id = 0, const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) { assert(!binding_.is_bound()); - binding_.Bind(request.Pass(), id, waiter); + binding_.Bind(request.Pass(), waiter); } bool WaitForIncomingMethodCall() { |