| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_ANDROID_COMPOSITOR_TAB_CONTENT_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_TAB_CONTENT_MANAGER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_TAB_CONTENT_MANAGER_H_ | 6 #define CHROME_BROWSER_ANDROID_COMPOSITOR_TAB_CONTENT_MANAGER_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 jint default_cache_size, | 41 jint default_cache_size, |
| 42 jint approximation_cache_size, | 42 jint approximation_cache_size, |
| 43 jint compression_queue_max_size, | 43 jint compression_queue_max_size, |
| 44 jint write_queue_max_size, | 44 jint write_queue_max_size, |
| 45 jboolean use_approximation_thumbnail); | 45 jboolean use_approximation_thumbnail); |
| 46 | 46 |
| 47 virtual ~TabContentManager(); | 47 virtual ~TabContentManager(); |
| 48 | 48 |
| 49 void Destroy(JNIEnv* env, jobject obj); | 49 void Destroy(JNIEnv* env, jobject obj); |
| 50 | 50 |
| 51 void SetUIResourceProvider(JNIEnv* env, | |
| 52 jobject obj, | |
| 53 jlong ui_resource_provider_ptr); | |
| 54 void SetUIResourceProvider(ui::UIResourceProvider* ui_resource_provider); | 51 void SetUIResourceProvider(ui::UIResourceProvider* ui_resource_provider); |
| 55 | 52 |
| 56 // Get the live layer from the cache. | 53 // Get the live layer from the cache. |
| 57 scoped_refptr<cc::Layer> GetLiveLayer(int tab_id); | 54 scoped_refptr<cc::Layer> GetLiveLayer(int tab_id); |
| 58 | 55 |
| 59 // Get the static thumbnail from the cache, or the NTP. | 56 // Get the static thumbnail from the cache, or the NTP. |
| 60 scoped_refptr<ThumbnailLayer> GetStaticLayer(int tab_id, | 57 scoped_refptr<ThumbnailLayer> GetStaticLayer(int tab_id, |
| 61 bool force_disk_read); | 58 bool force_disk_read); |
| 62 | 59 |
| 63 // Should be called when a tab gets a new live layer that should be served | 60 // Should be called when a tab gets a new live layer that should be served |
| (...skipping 19 matching lines...) Expand all Loading... |
| 83 jobject tab, | 80 jobject tab, |
| 84 jobject bitmap, | 81 jobject bitmap, |
| 85 jfloat thumbnail_scale); | 82 jfloat thumbnail_scale); |
| 86 void InvalidateIfChanged(JNIEnv* env, jobject obj, jint tab_id, jstring jurl); | 83 void InvalidateIfChanged(JNIEnv* env, jobject obj, jint tab_id, jstring jurl); |
| 87 void UpdateVisibleIds(JNIEnv* env, jobject obj, jintArray priority); | 84 void UpdateVisibleIds(JNIEnv* env, jobject obj, jintArray priority); |
| 88 void RemoveTabThumbnail(JNIEnv* env, jobject obj, jint tab_id); | 85 void RemoveTabThumbnail(JNIEnv* env, jobject obj, jint tab_id); |
| 89 void RemoveTabThumbnailFromDiskAtAndAboveId(JNIEnv* env, | 86 void RemoveTabThumbnailFromDiskAtAndAboveId(JNIEnv* env, |
| 90 jobject obj, | 87 jobject obj, |
| 91 jint min_forbidden_id); | 88 jint min_forbidden_id); |
| 92 void GetDecompressedThumbnail(JNIEnv* env, jobject obj, jint tab_id); | 89 void GetDecompressedThumbnail(JNIEnv* env, jobject obj, jint tab_id); |
| 90 void OnUIResourcesWereEvicted(); |
| 93 | 91 |
| 94 // ThumbnailCacheObserver implementation; | 92 // ThumbnailCacheObserver implementation; |
| 95 void OnFinishedThumbnailRead(TabId tab_id) override; | 93 void OnFinishedThumbnailRead(TabId tab_id) override; |
| 96 | 94 |
| 97 private: | 95 private: |
| 98 class TabReadbackRequest; | 96 class TabReadbackRequest; |
| 99 typedef base::hash_map<int, scoped_refptr<cc::Layer>> LayerMap; | 97 typedef base::hash_map<int, scoped_refptr<cc::Layer>> LayerMap; |
| 100 typedef base::hash_map<int, scoped_refptr<ThumbnailLayer>> ThumbnailLayerMap; | 98 typedef base::hash_map<int, scoped_refptr<ThumbnailLayer>> ThumbnailLayerMap; |
| 101 typedef base::ScopedPtrHashMap<int, scoped_ptr<TabReadbackRequest>> | 99 typedef base::ScopedPtrHashMap<int, scoped_ptr<TabReadbackRequest>> |
| 102 TabReadbackRequestMap; | 100 TabReadbackRequestMap; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 115 | 113 |
| 116 DISALLOW_COPY_AND_ASSIGN(TabContentManager); | 114 DISALLOW_COPY_AND_ASSIGN(TabContentManager); |
| 117 }; | 115 }; |
| 118 | 116 |
| 119 bool RegisterTabContentManager(JNIEnv* env); | 117 bool RegisterTabContentManager(JNIEnv* env); |
| 120 | 118 |
| 121 } // namespace android | 119 } // namespace android |
| 122 } // namespace chrome | 120 } // namespace chrome |
| 123 | 121 |
| 124 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_TAB_CONTENT_MANAGER_H_ | 122 #endif // CHROME_BROWSER_ANDROID_COMPOSITOR_TAB_CONTENT_MANAGER_H_ |
| OLD | NEW |