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

Unified Diff: components/copresence/copresence_manager_impl.h

Issue 2130803002: Deleting the copresence API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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
« no previous file with comments | « components/copresence/OWNERS ('k') | components/copresence/copresence_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/copresence/copresence_manager_impl.h
diff --git a/components/copresence/copresence_manager_impl.h b/components/copresence/copresence_manager_impl.h
deleted file mode 100644
index 63cac4b2883839a05267d1904acab6fc7bd83963..0000000000000000000000000000000000000000
--- a/components/copresence/copresence_manager_impl.h
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_COPRESENCE_COPRESENCE_MANAGER_IMPL_H_
-#define COMPONENTS_COPRESENCE_COPRESENCE_MANAGER_IMPL_H_
-
-#include <google/protobuf/repeated_field.h>
-
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "base/cancelable_callback.h"
-#include "base/macros.h"
-#include "components/copresence/copresence_state_impl.h"
-#include "components/copresence/public/copresence_manager.h"
-#include "components/copresence/timed_map.h"
-
-namespace audio_modem {
-struct AudioToken;
-}
-
-namespace base {
-class Timer;
-}
-
-namespace net {
-class URLContextGetter;
-}
-
-namespace copresence {
-
-class DirectiveHandler;
-class GCMHandler;
-class ReportRequest;
-class RpcHandler;
-class SubscribedMessage;
-
-// The implementation for CopresenceManager. Responsible primarily for
-// client-side initialization. The RpcHandler handles all the details
-// of interacting with the server.
-// TODO(ckehoe, rkc): Add tests for this class.
-class CopresenceManagerImpl : public CopresenceManager {
- public:
- // The delegate is owned by the caller, and must outlive the manager.
- explicit CopresenceManagerImpl(CopresenceDelegate* delegate);
-
- ~CopresenceManagerImpl() override;
-
- // CopresenceManager overrides.
- CopresenceState* state() override;
- void ExecuteReportRequest(const ReportRequest& request,
- const std::string& app_id,
- const std::string& auth_token,
- const StatusCallback& callback) override;
-
- private:
- // Complete initialization when Whispernet is available.
- void WhispernetInitComplete(bool success);
-
- // Handle tokens decoded by Whispernet.
- // TODO(ckehoe): Replace AudioToken with ReceivedToken.
- void ReceivedTokens(const std::vector<audio_modem::AudioToken>& tokens);
-
- // Verifies that we can hear the audio we're playing.
- // This gets called every kAudioCheckIntervalMs milliseconds.
- void AudioCheck();
-
- // This gets called every kPollTimerIntervalMs milliseconds
- // to poll the server for new messages.
- void PollForMessages();
-
- // Send SubscribedMessages to the appropriate clients.
- void DispatchMessages(
- const google::protobuf::RepeatedPtrField<SubscribedMessage>&
- subscribed_messages);
-
- // Belongs to the caller.
- CopresenceDelegate* const delegate_;
-
- // We use a CancelableCallback here because Whispernet
- // does not provide a way to unregister its init callback.
- base::CancelableCallback<void(bool)> whispernet_init_callback_;
-
- bool init_failed_;
-
- // The RpcHandler makes calls to the other objects here, so it must come last.
- std::unique_ptr<CopresenceStateImpl> state_;
- std::unique_ptr<DirectiveHandler> directive_handler_;
- std::unique_ptr<GCMHandler> gcm_handler_;
- std::unique_ptr<RpcHandler> rpc_handler_;
-
- std::unique_ptr<base::Timer> poll_timer_;
- std::unique_ptr<base::Timer> audio_check_timer_;
-
- TimedMap<std::string, google::protobuf::RepeatedPtrField<SubscribedMessage>>
- queued_messages_by_token_;
-
- DISALLOW_COPY_AND_ASSIGN(CopresenceManagerImpl);
-};
-
-} // namespace copresence
-
-#endif // COMPONENTS_COPRESENCE_COPRESENCE_MANAGER_IMPL_H_
« no previous file with comments | « components/copresence/OWNERS ('k') | components/copresence/copresence_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698