| 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 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 } | 843 } |
| 844 | 844 |
| 845 jboolean AwContents::RestoreFromOpaqueState( | 845 jboolean AwContents::RestoreFromOpaqueState( |
| 846 JNIEnv* env, jobject obj, jbyteArray state) { | 846 JNIEnv* env, jobject obj, jbyteArray state) { |
| 847 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 847 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 848 // TODO(boliu): This copy can be optimized out if this is a performance | 848 // TODO(boliu): This copy can be optimized out if this is a performance |
| 849 // problem. | 849 // problem. |
| 850 std::vector<uint8> state_vector; | 850 std::vector<uint8> state_vector; |
| 851 base::android::JavaByteArrayToByteVector(env, state, &state_vector); | 851 base::android::JavaByteArrayToByteVector(env, state, &state_vector); |
| 852 | 852 |
| 853 Pickle pickle(reinterpret_cast<const char*>(state_vector.begin()), | 853 Pickle pickle(reinterpret_cast<const char*>(state_vector.data()), |
| 854 state_vector.size()); | 854 state_vector.size()); |
| 855 PickleIterator iterator(pickle); | 855 PickleIterator iterator(pickle); |
| 856 | 856 |
| 857 return RestoreFromPickle(&iterator, web_contents_.get()); | 857 return RestoreFromPickle(&iterator, web_contents_.get()); |
| 858 } | 858 } |
| 859 | 859 |
| 860 bool AwContents::OnDraw(JNIEnv* env, | 860 bool AwContents::OnDraw(JNIEnv* env, |
| 861 jobject obj, | 861 jobject obj, |
| 862 jobject canvas, | 862 jobject canvas, |
| 863 jboolean is_hardware_accelerated, | 863 jboolean is_hardware_accelerated, |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 | 1149 |
| 1150 AwMessagePortServiceImpl::GetInstance()->CreateMessageChannel(env, ports, | 1150 AwMessagePortServiceImpl::GetInstance()->CreateMessageChannel(env, ports, |
| 1151 GetMessagePortMessageFilter()); | 1151 GetMessagePortMessageFilter()); |
| 1152 } | 1152 } |
| 1153 | 1153 |
| 1154 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 1154 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
| 1155 g_should_download_favicons = true; | 1155 g_should_download_favicons = true; |
| 1156 } | 1156 } |
| 1157 | 1157 |
| 1158 } // namespace android_webview | 1158 } // namespace android_webview |
| OLD | NEW |