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

Unified Diff: chrome/browser/extensions/api/copresence/copresence_api.h

Issue 800613002: Scoping auth tokens by app (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing unnecessary checks for empty app ID Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/copresence/copresence_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/copresence/copresence_api.h
diff --git a/chrome/browser/extensions/api/copresence/copresence_api.h b/chrome/browser/extensions/api/copresence/copresence_api.h
index 416b10abcfd01c8017039f272c3dfb56eb68d476..e05dca3c47ac8d42469dab2e383110584287b160 100644
--- a/chrome/browser/extensions/api/copresence/copresence_api.h
+++ b/chrome/browser/extensions/api/copresence/copresence_api.h
@@ -49,14 +49,13 @@ class CopresenceService final : public BrowserContextKeyedAPI,
return apps_by_subscription_id_;
}
+ const std::string auth_token(const std::string& app_id) const;
+
void set_api_key(const std::string& app_id,
const std::string& api_key);
- std::string auth_token() const {
- return auth_token_;
- }
-
- void set_auth_token(const std::string& token);
+ void set_auth_token(const std::string& app_id,
+ const std::string& token);
// Manager override for testing.
void set_manager_for_testing(
@@ -83,14 +82,12 @@ class CopresenceService final : public BrowserContextKeyedAPI,
static const char* service_name() { return "CopresenceService"; }
bool is_shutting_down_;
+ content::BrowserContext* const browser_context_;
+
std::map<std::string, std::string> apps_by_subscription_id_;
- content::BrowserContext* const browser_context_;
std::map<std::string, std::string> api_keys_by_app_;
-
- // TODO(ckehoe): This is a temporary hack.
- // Auth tokens from different apps needs to be separated properly.
- std::string auth_token_;
+ std::map<std::string, std::string> auth_tokens_by_app_;
scoped_ptr<copresence::CopresenceManager> manager_;
scoped_ptr<ChromeWhispernetClient> whispernet_client_;
« no previous file with comments | « no previous file | chrome/browser/extensions/api/copresence/copresence_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698