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

Side by Side Diff: content/common/mojo/mojo_shell_connection_impl.cc

Issue 1719193003: Add a user id parameter to connections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 10 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 | « content/common/mojo/mojo_shell_connection_impl.h ('k') | content/public/test/test_mojo_app.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/common/mojo/mojo_shell_connection_impl.h" 5 #include "content/common/mojo/mojo_shell_connection_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 mojo::ScopedMessagePipeHandle handle) { 66 mojo::ScopedMessagePipeHandle handle) {
67 mojo::ShellClientRequest request; 67 mojo::ShellClientRequest request;
68 runner_connection_.reset(mojo::shell::RunnerConnection::ConnectToRunner( 68 runner_connection_.reset(mojo::shell::RunnerConnection::ConnectToRunner(
69 &request, std::move(handle))); 69 &request, std::move(handle)));
70 shell_connection_.reset(new mojo::ShellConnection(this, std::move(request))); 70 shell_connection_.reset(new mojo::ShellConnection(this, std::move(request)));
71 shell_connection_->WaitForInitialize(); 71 shell_connection_->WaitForInitialize();
72 } 72 }
73 73
74 void MojoShellConnectionImpl::Initialize(mojo::Shell* shell, 74 void MojoShellConnectionImpl::Initialize(mojo::Shell* shell,
75 const std::string& url, 75 const std::string& url,
76 uint32_t id) { 76 uint32_t id,
77 uint32_t user_id) {
77 initialized_ = true; 78 initialized_ = true;
78 } 79 }
79 80
80 bool MojoShellConnectionImpl::AcceptConnection(mojo::Connection* connection) { 81 bool MojoShellConnectionImpl::AcceptConnection(mojo::Connection* connection) {
81 bool found = false; 82 bool found = false;
82 for (auto listener : listeners_) 83 for (auto listener : listeners_)
83 found |= listener->AcceptConnection(connection); 84 found |= listener->AcceptConnection(connection);
84 return found; 85 return found;
85 } 86 }
86 87
(...skipping 26 matching lines...) Expand all
113 // static 114 // static
114 void MojoShellConnection::Destroy() { 115 void MojoShellConnection::Destroy() {
115 // This joins the shell controller thread. 116 // This joins the shell controller thread.
116 delete Get(); 117 delete Get();
117 lazy_tls_ptr.Pointer()->Set(nullptr); 118 lazy_tls_ptr.Pointer()->Set(nullptr);
118 } 119 }
119 120
120 MojoShellConnection::~MojoShellConnection() {} 121 MojoShellConnection::~MojoShellConnection() {}
121 122
122 } // namespace content 123 } // namespace content
OLDNEW
« no previous file with comments | « content/common/mojo/mojo_shell_connection_impl.h ('k') | content/public/test/test_mojo_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698