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

Side by Side Diff: chrome/browser/extensions/api/identity/extension_token_key.cc

Issue 163013002: [Identity] Use const ref on ExtensionTokenKey parameter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/api/identity/extension_token_key.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/extensions/api/identity/extension_token_key.h" 5 #include "chrome/browser/extensions/api/identity/extension_token_key.h"
6 6
7 namespace extensions { 7 namespace extensions {
8 8
9 ExtensionTokenKey::ExtensionTokenKey(const std::string& extension_id, 9 ExtensionTokenKey::ExtensionTokenKey(const std::string& extension_id,
10 const std::string& account_id, 10 const std::string& account_id,
11 const std::set<std::string> scopes) 11 const std::set<std::string>& scopes)
12 : extension_id(extension_id), account_id(account_id), scopes(scopes) {} 12 : extension_id(extension_id), account_id(account_id), scopes(scopes) {}
13 13
14 ExtensionTokenKey::~ExtensionTokenKey() {} 14 ExtensionTokenKey::~ExtensionTokenKey() {}
15 15
16 bool ExtensionTokenKey::operator<(const ExtensionTokenKey& rhs) const { 16 bool ExtensionTokenKey::operator<(const ExtensionTokenKey& rhs) const {
17 if (extension_id < rhs.extension_id) 17 if (extension_id < rhs.extension_id)
18 return true; 18 return true;
19 else if (rhs.extension_id < extension_id) 19 else if (rhs.extension_id < extension_id)
20 return false; 20 return false;
21 21
22 if (account_id < rhs.account_id) 22 if (account_id < rhs.account_id)
23 return true; 23 return true;
24 else if (rhs.account_id < account_id) 24 else if (rhs.account_id < account_id)
25 return false; 25 return false;
26 26
27 return scopes < rhs.scopes; 27 return scopes < rhs.scopes;
28 } 28 }
29 29
30 } // namespace extensions 30 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/identity/extension_token_key.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698