OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #include "android_webview/native/aw_contents.h" | 5 #include "android_webview/native/aw_contents.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "android_webview/browser/aw_browser_context.h" | 9 #include "android_webview/browser/aw_browser_context.h" |
10 #include "android_webview/browser/aw_browser_main_parts.h" | 10 #include "android_webview/browser/aw_browser_main_parts.h" |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 } | 844 } |
845 | 845 |
846 jboolean AwContents::RestoreFromOpaqueState( | 846 jboolean AwContents::RestoreFromOpaqueState( |
847 JNIEnv* env, jobject obj, jbyteArray state) { | 847 JNIEnv* env, jobject obj, jbyteArray state) { |
848 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 848 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
849 // TODO(boliu): This copy can be optimized out if this is a performance | 849 // TODO(boliu): This copy can be optimized out if this is a performance |
850 // problem. | 850 // problem. |
851 std::vector<uint8> state_vector; | 851 std::vector<uint8> state_vector; |
852 base::android::JavaByteArrayToByteVector(env, state, &state_vector); | 852 base::android::JavaByteArrayToByteVector(env, state, &state_vector); |
853 | 853 |
854 Pickle pickle(reinterpret_cast<const char*>(state_vector.begin()), | 854 Pickle pickle(reinterpret_cast<const char*>(state_vector.data()), |
855 state_vector.size()); | 855 state_vector.size()); |
856 PickleIterator iterator(pickle); | 856 PickleIterator iterator(pickle); |
857 | 857 |
858 return RestoreFromPickle(&iterator, web_contents_.get()); | 858 return RestoreFromPickle(&iterator, web_contents_.get()); |
859 } | 859 } |
860 | 860 |
861 bool AwContents::OnDraw(JNIEnv* env, | 861 bool AwContents::OnDraw(JNIEnv* env, |
862 jobject obj, | 862 jobject obj, |
863 jobject canvas, | 863 jobject canvas, |
864 jboolean is_hardware_accelerated, | 864 jboolean is_hardware_accelerated, |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 } | 1062 } |
1063 | 1063 |
1064 browser_view_renderer_.TrimMemory(level, visible); | 1064 browser_view_renderer_.TrimMemory(level, visible); |
1065 } | 1065 } |
1066 | 1066 |
1067 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 1067 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
1068 g_should_download_favicons = true; | 1068 g_should_download_favicons = true; |
1069 } | 1069 } |
1070 | 1070 |
1071 } // namespace android_webview | 1071 } // namespace android_webview |
OLD | NEW |