| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_PUBLIC_BLIMP_CLIENT_CONTEXT_H_ | 5 #ifndef BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_H_ |
| 6 #define BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_H_ | 6 #define BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> |
| 9 | 10 |
| 10 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 11 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
| 12 #include "blimp/client/public/blimp_client_context_delegate.h" | 13 #include "blimp/client/public/blimp_client_context_delegate.h" |
| 13 #include "blimp/client/public/contents/blimp_contents.h" | 14 #include "blimp/client/public/contents/blimp_contents.h" |
| 14 #include "components/keyed_service/core/keyed_service.h" | 15 #include "components/keyed_service/core/keyed_service.h" |
| 15 | 16 |
| 16 #if defined(OS_ANDROID) | 17 #if defined(OS_ANDROID) |
| 17 #include "base/android/jni_android.h" | 18 #include "base/android/jni_android.h" |
| 18 #endif // defined(OS_ANDROID) | 19 #endif // defined(OS_ANDROID) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 34 // BlimpClientContext. | 35 // BlimpClientContext. |
| 35 static base::android::ScopedJavaLocalRef<jobject> GetJavaObject( | 36 static base::android::ScopedJavaLocalRef<jobject> GetJavaObject( |
| 36 BlimpClientContext* blimp_client_context); | 37 BlimpClientContext* blimp_client_context); |
| 37 #endif // defined(OS_ANDROID) | 38 #endif // defined(OS_ANDROID) |
| 38 | 39 |
| 39 // Creates a BlimpClientContext. The implementation of this function | 40 // Creates a BlimpClientContext. The implementation of this function |
| 40 // depends on whether the core or dummy implementation of Blimp has been | 41 // depends on whether the core or dummy implementation of Blimp has been |
| 41 // linked in. | 42 // linked in. |
| 42 // The |io_thread_task_runner| must be the task runner to use for IO | 43 // The |io_thread_task_runner| must be the task runner to use for IO |
| 43 // operations. | 44 // operations. |
| 45 // The |file_thread_task_runner| must be the task runner to use for file |
| 46 // operations. |
| 44 static BlimpClientContext* Create( | 47 static BlimpClientContext* Create( |
| 45 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner); | 48 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner, |
| 49 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner); |
| 46 | 50 |
| 47 // The delegate provides all the required functionality from the embedder. | 51 // The delegate provides all the required functionality from the embedder. |
| 48 virtual void SetDelegate(BlimpClientContextDelegate* delegate) = 0; | 52 virtual void SetDelegate(BlimpClientContextDelegate* delegate) = 0; |
| 49 | 53 |
| 50 // Creates a new BlimpContents. | 54 // Creates a new BlimpContents. |
| 51 virtual std::unique_ptr<BlimpContents> CreateBlimpContents() = 0; | 55 virtual std::unique_ptr<BlimpContents> CreateBlimpContents() = 0; |
| 52 | 56 |
| 57 // Initiates the process for connecting to the engine. |
| 58 virtual void Connect(const std::string& client_auth_token) = 0; |
| 59 |
| 53 protected: | 60 protected: |
| 54 BlimpClientContext() = default; | 61 BlimpClientContext() = default; |
| 55 | 62 |
| 56 private: | 63 private: |
| 57 DISALLOW_COPY_AND_ASSIGN(BlimpClientContext); | 64 DISALLOW_COPY_AND_ASSIGN(BlimpClientContext); |
| 58 }; | 65 }; |
| 59 | 66 |
| 60 } // namespace client | 67 } // namespace client |
| 61 } // namespace blimp | 68 } // namespace blimp |
| 62 | 69 |
| 63 #endif // BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_H_ | 70 #endif // BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_H_ |
| OLD | NEW |