| 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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 } | 848 } |
| 849 | 849 |
| 850 jboolean AwContents::RestoreFromOpaqueState( | 850 jboolean AwContents::RestoreFromOpaqueState( |
| 851 JNIEnv* env, jobject obj, jbyteArray state) { | 851 JNIEnv* env, jobject obj, jbyteArray state) { |
| 852 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 852 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 853 // TODO(boliu): This copy can be optimized out if this is a performance | 853 // TODO(boliu): This copy can be optimized out if this is a performance |
| 854 // problem. | 854 // problem. |
| 855 std::vector<uint8> state_vector; | 855 std::vector<uint8> state_vector; |
| 856 base::android::JavaByteArrayToByteVector(env, state, &state_vector); | 856 base::android::JavaByteArrayToByteVector(env, state, &state_vector); |
| 857 | 857 |
| 858 Pickle pickle(reinterpret_cast<const char*>(state_vector.begin()), | 858 Pickle pickle(reinterpret_cast<const char*>(state_vector.data()), |
| 859 state_vector.size()); | 859 state_vector.size()); |
| 860 PickleIterator iterator(pickle); | 860 PickleIterator iterator(pickle); |
| 861 | 861 |
| 862 return RestoreFromPickle(&iterator, web_contents_.get()); | 862 return RestoreFromPickle(&iterator, web_contents_.get()); |
| 863 } | 863 } |
| 864 | 864 |
| 865 bool AwContents::OnDraw(JNIEnv* env, | 865 bool AwContents::OnDraw(JNIEnv* env, |
| 866 jobject obj, | 866 jobject obj, |
| 867 jobject canvas, | 867 jobject canvas, |
| 868 jboolean is_hardware_accelerated, | 868 jboolean is_hardware_accelerated, |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 base::Owned(port1), | 1125 base::Owned(port1), |
| 1126 base::Owned(port2))); | 1126 base::Owned(port2))); |
| 1127 } | 1127 } |
| 1128 | 1128 |
| 1129 | 1129 |
| 1130 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 1130 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
| 1131 g_should_download_favicons = true; | 1131 g_should_download_favicons = true; |
| 1132 } | 1132 } |
| 1133 | 1133 |
| 1134 } // namespace android_webview | 1134 } // namespace android_webview |
| OLD | NEW |