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 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 } | 951 } |
952 | 952 |
953 jboolean AwContents::RestoreFromOpaqueState( | 953 jboolean AwContents::RestoreFromOpaqueState( |
954 JNIEnv* env, jobject obj, jbyteArray state) { | 954 JNIEnv* env, jobject obj, jbyteArray state) { |
955 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 955 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
956 // TODO(boliu): This copy can be optimized out if this is a performance | 956 // TODO(boliu): This copy can be optimized out if this is a performance |
957 // problem. | 957 // problem. |
958 std::vector<uint8> state_vector; | 958 std::vector<uint8> state_vector; |
959 base::android::JavaByteArrayToByteVector(env, state, &state_vector); | 959 base::android::JavaByteArrayToByteVector(env, state, &state_vector); |
960 | 960 |
961 Pickle pickle(reinterpret_cast<const char*>(state_vector.begin()), | 961 Pickle pickle(reinterpret_cast<const char*>(state_vector.data()), |
962 state_vector.size()); | 962 state_vector.size()); |
963 PickleIterator iterator(pickle); | 963 PickleIterator iterator(pickle); |
964 | 964 |
965 return RestoreFromPickle(&iterator, web_contents_.get()); | 965 return RestoreFromPickle(&iterator, web_contents_.get()); |
966 } | 966 } |
967 | 967 |
968 bool AwContents::OnDraw(JNIEnv* env, | 968 bool AwContents::OnDraw(JNIEnv* env, |
969 jobject obj, | 969 jobject obj, |
970 jobject canvas, | 970 jobject canvas, |
971 jboolean is_hardware_accelerated, | 971 jboolean is_hardware_accelerated, |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1169 } | 1169 } |
1170 | 1170 |
1171 browser_view_renderer_.TrimMemory(level, visible); | 1171 browser_view_renderer_.TrimMemory(level, visible); |
1172 } | 1172 } |
1173 | 1173 |
1174 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 1174 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
1175 g_should_download_favicons = true; | 1175 g_should_download_favicons = true; |
1176 } | 1176 } |
1177 | 1177 |
1178 } // namespace android_webview | 1178 } // namespace android_webview |
OLD | NEW |