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

Unified Diff: chrome/browser/copresence/chrome_whispernet_client.h

Issue 916763005: Allowing WhispernetClient to be used during initialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/copresence/chrome_whispernet_client.h
diff --git a/chrome/browser/copresence/chrome_whispernet_client.h b/chrome/browser/copresence/chrome_whispernet_client.h
index 8b0e4f73577ffefd042b16e87fde79159ed2a549..f6db53a84ded7e0e89db5779c8ba2a2918510041 100644
--- a/chrome/browser/copresence/chrome_whispernet_client.h
+++ b/chrome/browser/copresence/chrome_whispernet_client.h
@@ -18,12 +18,17 @@ class BrowserContext;
}
namespace extensions {
+
+struct Event;
+class EventRouter;
+
namespace api {
namespace copresence_private {
struct AudioParameters;
}
}
-}
+
+} // namespace extensions
namespace media {
class AudioBusRefCounted;
@@ -64,11 +69,14 @@ class ChromeWhispernetClient final : public copresence::WhispernetClient {
// Fire an event to configure whispernet with the given audio parameters.
void AudioConfiguration(const copresence::config::AudioParamData& params);
+ void SendEventIfLoaded(scoped_ptr<extensions::Event> event);
+
// This gets called twice; once when the proxy extension loads, the second
// time when we have initialized the proxy extension's encoder and decoder.
void OnExtensionLoaded(bool success);
- content::BrowserContext* browser_context_;
+ content::BrowserContext* const browser_context_;
+ extensions::EventRouter* const event_router_;
copresence::SuccessCallback extension_loaded_callback_;
copresence::SuccessCallback init_callback_;
@@ -77,6 +85,7 @@ class ChromeWhispernetClient final : public copresence::WhispernetClient {
copresence::SamplesCallback samples_callback_;
copresence::SuccessCallback db_callback_;
+ std::vector<scoped_ptr<extensions::Event>> queued_events_;
bool extension_loaded_;
DISALLOW_COPY_AND_ASSIGN(ChromeWhispernetClient);

Powered by Google App Engine
This is Rietveld 408576698