Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: content/browser/mojo/mojo_shell_context.cc

Issue 1921183003: Fixes race in Shell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge 2 trunk Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | services/catalog/catalog.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/mojo/mojo_shell_context.h" 5 #include "content/browser/mojo/mojo_shell_context.h"
6 6
7 #include <unordered_map> 7 #include <unordered_map>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 // Attach our ShellClientFactory implementation to the global connection. 303 // Attach our ShellClientFactory implementation to the global connection.
304 MojoShellConnection* shell_connection = MojoShellConnection::Get(); 304 MojoShellConnection* shell_connection = MojoShellConnection::Get();
305 CHECK(shell_connection); 305 CHECK(shell_connection);
306 shell_connection->AddListener(base::WrapUnique( 306 shell_connection->AddListener(base::WrapUnique(
307 new ShellConnectionListener(std::move(browser_shell_connection)))); 307 new ShellConnectionListener(std::move(browser_shell_connection))));
308 } 308 }
309 309
310 MojoShellContext::~MojoShellContext() { 310 MojoShellContext::~MojoShellContext() {
311 if (!IsRunningInMojoShell()) 311 if (!IsRunningInMojoShell())
312 MojoShellConnectionImpl::Destroy(); 312 MojoShellConnectionImpl::Destroy();
313 catalog_.reset();
313 } 314 }
314 315
315 // static 316 // static
316 void MojoShellContext::ConnectToApplication( 317 void MojoShellContext::ConnectToApplication(
317 const std::string& user_id, 318 const std::string& user_id,
318 const std::string& name, 319 const std::string& name,
319 const std::string& requestor_name, 320 const std::string& requestor_name,
320 shell::mojom::InterfaceProviderRequest request, 321 shell::mojom::InterfaceProviderRequest request,
321 shell::mojom::InterfaceProviderPtr exposed_services, 322 shell::mojom::InterfaceProviderPtr exposed_services,
322 const shell::mojom::Connector::ConnectCallback& callback) { 323 const shell::mojom::Connector::ConnectCallback& callback) {
(...skipping 13 matching lines...) Expand all
336 shell::Identity source_id(requestor_name, user_id); 337 shell::Identity source_id(requestor_name, user_id);
337 params->set_source(source_id); 338 params->set_source(source_id);
338 params->set_target(shell::Identity(name, user_id)); 339 params->set_target(shell::Identity(name, user_id));
339 params->set_remote_interfaces(std::move(request)); 340 params->set_remote_interfaces(std::move(request));
340 params->set_local_interfaces(std::move(exposed_services)); 341 params->set_local_interfaces(std::move(exposed_services));
341 params->set_connect_callback(callback); 342 params->set_connect_callback(callback);
342 shell_->Connect(std::move(params)); 343 shell_->Connect(std::move(params));
343 } 344 }
344 345
345 } // namespace content 346 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | services/catalog/catalog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698