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

Side by Side Diff: mojo/shell/identity.cc

Issue 1728083002: Extract a Connector interface from Shell that can be cloned & passed to other threads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@12uid
Patch Set: . Created 4 years, 9 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
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 "mojo/shell/identity.h" 5 #include "mojo/shell/identity.h"
6 6
7 #include "mojo/shell/public/interfaces/shell.mojom.h" 7 #include "mojo/shell/public/interfaces/shell.mojom.h"
8 8
9 namespace mojo { 9 namespace mojo {
10 namespace shell { 10 namespace shell {
(...skipping 12 matching lines...) Expand all
23 canonicalized[GURL(it->first).spec()] = it->second; 23 canonicalized[GURL(it->first).spec()] = it->second;
24 } 24 }
25 return canonicalized; 25 return canonicalized;
26 } 26 }
27 27
28 } // namespace 28 } // namespace
29 29
30 Identity::Identity() {} 30 Identity::Identity() {}
31 31
32 Identity::Identity(const GURL& url) 32 Identity::Identity(const GURL& url)
33 : Identity(url, url.spec(), mojom::Shell::kUserRoot) {} 33 : Identity(url, url.spec(), mojom::Connector::kUserRoot) {}
34 34
35 Identity::Identity(const GURL& url, const std::string& qualifier, 35 Identity::Identity(const GURL& url, const std::string& qualifier,
36 uint32_t user_id) 36 uint32_t user_id)
37 : Identity(url, qualifier, user_id, CapabilityFilter()) {} 37 : Identity(url, qualifier, user_id, CapabilityFilter()) {}
38 38
39 Identity::Identity(const GURL& url, const std::string& qualifier, 39 Identity::Identity(const GURL& url, const std::string& qualifier,
40 uint32_t user_id, CapabilityFilter filter) 40 uint32_t user_id, CapabilityFilter filter)
41 : url_(url), 41 : url_(url),
42 qualifier_(qualifier.empty() ? url_.spec() : qualifier), 42 qualifier_(qualifier.empty() ? url_.spec() : qualifier),
43 user_id_(user_id), 43 user_id_(user_id),
(...skipping 12 matching lines...) Expand all
56 return user_id_ < other.user_id_; 56 return user_id_ < other.user_id_;
57 } 57 }
58 58
59 bool Identity::operator==(const Identity& other) const { 59 bool Identity::operator==(const Identity& other) const {
60 return other.url_ == url_ && other.qualifier_ == qualifier_ && 60 return other.url_ == url_ && other.qualifier_ == qualifier_ &&
61 other.filter_ == filter_ && other.user_id_ == user_id_; 61 other.filter_ == filter_ && other.user_id_ == user_id_;
62 } 62 }
63 63
64 Identity CreateShellIdentity() { 64 Identity CreateShellIdentity() {
65 return Identity(GURL("mojo://shell/"), std::string(), 65 return Identity(GURL("mojo://shell/"), std::string(),
66 mojom::Shell::kUserRoot, GetPermissiveCapabilityFilter()); 66 mojom::Connector::kUserRoot, GetPermissiveCapabilityFilter());
67 } 67 }
68 68
69 } // namespace shell 69 } // namespace shell
70 } // namespace mojo 70 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698