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

Unified Diff: blimp/client/session/blimp_client_session.h

Issue 2387813002: Move session into //blimp/client/app and update GN files. (Closed)
Patch Set: Rebased Created 4 years, 2 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 | « blimp/client/core/switches/BUILD.gn ('k') | blimp/client/session/blimp_client_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/session/blimp_client_session.h
diff --git a/blimp/client/session/blimp_client_session.h b/blimp/client/session/blimp_client_session.h
deleted file mode 100644
index 8413f1ee65cb8697f00356645b3f0f1f0671ff4e..0000000000000000000000000000000000000000
--- a/blimp/client/session/blimp_client_session.h
+++ /dev/null
@@ -1,136 +0,0 @@
-// Copyright 2015 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 BLIMP_CLIENT_SESSION_BLIMP_CLIENT_SESSION_H_
-#define BLIMP_CLIENT_SESSION_BLIMP_CLIENT_SESSION_H_
-
-#include <memory>
-#include <string>
-
-#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
-#include "base/threading/thread.h"
-#include "blimp/client/core/compositor/blob_image_serialization_processor.h"
-#include "blimp/client/core/session/assignment_source.h"
-#include "blimp/client/core/session/network_event_observer.h"
-#include "blimp/client/public/session/assignment.h"
-#include "blimp/common/proto/blimp_message.pb.h"
-#include "blimp/net/blimp_message_processor.h"
-
-namespace net {
-class IPEndPoint;
-}
-
-namespace blimp {
-
-class BlimpMessageProcessor;
-class BlimpMessageThreadPipe;
-class BlobChannelReceiver;
-class BrowserConnectionHandler;
-class ClientConnectionManager;
-class HeliumBlobReceiverDelegate;
-class ThreadPipeManager;
-
-namespace client {
-
-class ClientNetworkComponents;
-class GeolocationFeature;
-class NavigationFeature;
-class ImeFeature;
-class RenderWidgetFeature;
-class SettingsFeature;
-class TabControlFeature;
-
-// BlimpClientSession represents a single active session of Blimp on the client
-// regardless of whether or not the client application is in the background or
-// foreground. The only time this session is invalid is during initialization
-// and shutdown of this particular client process (or Activity on Android).
-//
-// This session glues together the feature proxy components and the network
-// layer. The network components must be interacted with on the IO thread. The
-// feature proxies must be interacted with on the UI thread.
-class BlimpClientSession
- : public NetworkEventObserver,
- public BlobImageSerializationProcessor::ErrorDelegate {
- public:
- explicit BlimpClientSession(const GURL& assigner_endpoint);
-
- // Uses the AssignmentSource to get an Assignment and then uses the assignment
- // configuration to connect to the Blimplet.
- // |client_auth_token| is the OAuth2 access token to use when querying
- // for an assignment. This token needs the OAuth2 scope of userinfo.email and
- // only needs to be an access token, not a refresh token.
- void Connect(const std::string& client_auth_token);
-
- TabControlFeature* GetTabControlFeature() const;
- NavigationFeature* GetNavigationFeature() const;
- ImeFeature* GetImeFeature() const;
- RenderWidgetFeature* GetRenderWidgetFeature() const;
- SettingsFeature* GetSettingsFeature() const;
-
- // The AssignmentCallback for when an assignment is ready. This will trigger
- // a connection to the engine.
- virtual void ConnectWithAssignment(AssignmentRequestResult result,
- const Assignment& assignment);
-
- protected:
- ~BlimpClientSession() override;
-
- // Notified every time the AssignmentSource returns the result of an attempted
- // assignment request.
- virtual void OnAssignmentConnectionAttempted(AssignmentRequestResult result,
- const Assignment& assignment);
-
- private:
- void RegisterFeatures();
-
- // Terminates the active connection held by |net_connections_| on the IO
- // thread. Should be called on the main thread.
- void DropConnection();
-
- // NetworkEventObserver implementation.
- void OnConnected() override;
- void OnDisconnected(int result) override;
-
- // BlobImageSerializationProcessor::ErrorDelegate implementation.
- void OnImageDecodeError() override;
-
- base::Thread io_thread_;
-
- // Receives blob BlimpMessages and relays them to BlobChannelReceiver.
- // Owned by BlobChannelReceiver, therefore stored as a raw pointer here.
- HeliumBlobReceiverDelegate* blob_delegate_ = nullptr;
-
- // Retrieves and decodes image data from |blob_receiver_|. Must outlive
- // |blob_receiver_|.
- BlobImageSerializationProcessor blob_image_processor_;
-
- std::unique_ptr<BlobChannelReceiver> blob_receiver_;
- std::unique_ptr<GeolocationFeature> geolocation_feature_;
- std::unique_ptr<TabControlFeature> tab_control_feature_;
- std::unique_ptr<NavigationFeature> navigation_feature_;
- std::unique_ptr<ImeFeature> ime_feature_;
- std::unique_ptr<RenderWidgetFeature> render_widget_feature_;
- std::unique_ptr<SettingsFeature> settings_feature_;
-
- // The AssignmentSource is used when the user of BlimpClientSession calls
- // Connect() to get a valid assignment and later connect to the engine.
- std::unique_ptr<AssignmentSource> assignment_source_;
-
- // Container struct for network components.
- // Must be deleted on the IO thread.
- std::unique_ptr<ClientNetworkComponents> net_components_;
-
- std::unique_ptr<ThreadPipeManager> thread_pipe_manager_;
-
- base::WeakPtrFactory<BlimpClientSession> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(BlimpClientSession);
-};
-
-} // namespace client
-} // namespace blimp
-
-#endif // BLIMP_CLIENT_SESSION_BLIMP_CLIENT_SESSION_H_
« no previous file with comments | « blimp/client/core/switches/BUILD.gn ('k') | blimp/client/session/blimp_client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698