| 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 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 } | 825 } |
| 826 | 826 |
| 827 jboolean AwContents::RestoreFromOpaqueState( | 827 jboolean AwContents::RestoreFromOpaqueState( |
| 828 JNIEnv* env, jobject obj, jbyteArray state) { | 828 JNIEnv* env, jobject obj, jbyteArray state) { |
| 829 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 829 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 830 // TODO(boliu): This copy can be optimized out if this is a performance | 830 // TODO(boliu): This copy can be optimized out if this is a performance |
| 831 // problem. | 831 // problem. |
| 832 std::vector<uint8> state_vector; | 832 std::vector<uint8> state_vector; |
| 833 base::android::JavaByteArrayToByteVector(env, state, &state_vector); | 833 base::android::JavaByteArrayToByteVector(env, state, &state_vector); |
| 834 | 834 |
| 835 Pickle pickle(reinterpret_cast<const char*>(state_vector.begin()), | 835 Pickle pickle(reinterpret_cast<const char*>(state_vector.data()), |
| 836 state_vector.size()); | 836 state_vector.size()); |
| 837 PickleIterator iterator(pickle); | 837 PickleIterator iterator(pickle); |
| 838 | 838 |
| 839 return RestoreFromPickle(&iterator, web_contents_.get()); | 839 return RestoreFromPickle(&iterator, web_contents_.get()); |
| 840 } | 840 } |
| 841 | 841 |
| 842 bool AwContents::OnDraw(JNIEnv* env, | 842 bool AwContents::OnDraw(JNIEnv* env, |
| 843 jobject obj, | 843 jobject obj, |
| 844 jobject canvas, | 844 jobject canvas, |
| 845 jboolean is_hardware_accelerated, | 845 jboolean is_hardware_accelerated, |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1048 jboolean visible) { | 1048 jboolean visible) { |
| 1049 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1049 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1050 browser_view_renderer_.TrimMemory(level, visible); | 1050 browser_view_renderer_.TrimMemory(level, visible); |
| 1051 } | 1051 } |
| 1052 | 1052 |
| 1053 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 1053 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
| 1054 g_should_download_favicons = true; | 1054 g_should_download_favicons = true; |
| 1055 } | 1055 } |
| 1056 | 1056 |
| 1057 } // namespace android_webview | 1057 } // namespace android_webview |
| OLD | NEW |