| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef BLIMP_CLIENT_SESSION_BLIMP_CLIENT_SESSION_H_ | 5 #ifndef BLIMP_CLIENT_SESSION_BLIMP_CLIENT_SESSION_H_ |
| 6 #define BLIMP_CLIENT_SESSION_BLIMP_CLIENT_SESSION_H_ | 6 #define BLIMP_CLIENT_SESSION_BLIMP_CLIENT_SESSION_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
| 14 #include "blimp/client/blimp_client_export.h" | |
| 15 #include "blimp/client/session/assignment_source.h" | 14 #include "blimp/client/session/assignment_source.h" |
| 16 #include "blimp/common/proto/blimp_message.pb.h" | 15 #include "blimp/common/proto/blimp_message.pb.h" |
| 17 #include "blimp/net/blimp_message_processor.h" | 16 #include "blimp/net/blimp_message_processor.h" |
| 18 | 17 |
| 19 namespace net { | 18 namespace net { |
| 20 class IPEndPoint; | 19 class IPEndPoint; |
| 21 } | 20 } |
| 22 | 21 |
| 23 namespace blimp { | 22 namespace blimp { |
| 24 | 23 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 47 }; | 46 }; |
| 48 | 47 |
| 49 // BlimpClientSession represents a single active session of Blimp on the client | 48 // BlimpClientSession represents a single active session of Blimp on the client |
| 50 // regardless of whether or not the client application is in the background or | 49 // regardless of whether or not the client application is in the background or |
| 51 // foreground. The only time this session is invalid is during initialization | 50 // foreground. The only time this session is invalid is during initialization |
| 52 // and shutdown of this particular client process (or Activity on Android). | 51 // and shutdown of this particular client process (or Activity on Android). |
| 53 // | 52 // |
| 54 // This session glues together the feature proxy components and the network | 53 // This session glues together the feature proxy components and the network |
| 55 // layer. The network components must be interacted with on the IO thread. The | 54 // layer. The network components must be interacted with on the IO thread. The |
| 56 // feature proxies must be interacted with on the UI thread. | 55 // feature proxies must be interacted with on the UI thread. |
| 57 class BLIMP_CLIENT_EXPORT BlimpClientSession : public NetworkEventObserver { | 56 class BlimpClientSession : public NetworkEventObserver { |
| 58 public: | 57 public: |
| 59 explicit BlimpClientSession(const GURL& assigner_endpoint); | 58 explicit BlimpClientSession(const GURL& assigner_endpoint); |
| 60 | 59 |
| 61 // Uses the AssignmentSource to get an Assignment and then uses the assignment | 60 // Uses the AssignmentSource to get an Assignment and then uses the assignment |
| 62 // configuration to connect to the Blimplet. | 61 // configuration to connect to the Blimplet. |
| 63 // |client_auth_token| is the OAuth2 access token to use when querying | 62 // |client_auth_token| is the OAuth2 access token to use when querying |
| 64 // for an assignment. This token needs the OAuth2 scope of userinfo.email and | 63 // for an assignment. This token needs the OAuth2 scope of userinfo.email and |
| 65 // only needs to be an access token, not a refresh token. | 64 // only needs to be an access token, not a refresh token. |
| 66 void Connect(const std::string& client_auth_token); | 65 void Connect(const std::string& client_auth_token); |
| 67 | 66 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 109 |
| 111 base::WeakPtrFactory<BlimpClientSession> weak_factory_; | 110 base::WeakPtrFactory<BlimpClientSession> weak_factory_; |
| 112 | 111 |
| 113 DISALLOW_COPY_AND_ASSIGN(BlimpClientSession); | 112 DISALLOW_COPY_AND_ASSIGN(BlimpClientSession); |
| 114 }; | 113 }; |
| 115 | 114 |
| 116 } // namespace client | 115 } // namespace client |
| 117 } // namespace blimp | 116 } // namespace blimp |
| 118 | 117 |
| 119 #endif // BLIMP_CLIENT_SESSION_BLIMP_CLIENT_SESSION_H_ | 118 #endif // BLIMP_CLIENT_SESSION_BLIMP_CLIENT_SESSION_H_ |
| OLD | NEW |