OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/android/tab_state.h" | 5 #include "chrome/browser/android/tab_state.h" |
6 | 6 |
7 #include <jni.h> | 7 #include <jni.h> |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
8 #include <limits> | 10 #include <limits> |
9 #include <vector> | 11 #include <vector> |
10 | 12 |
11 #include "base/android/jni_android.h" | 13 #include "base/android/jni_android.h" |
12 #include "base/android/jni_string.h" | 14 #include "base/android/jni_string.h" |
13 #include "base/logging.h" | 15 #include "base/logging.h" |
14 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/scoped_vector.h" | 17 #include "base/memory/scoped_vector.h" |
16 #include "base/pickle.h" | 18 #include "base/pickle.h" |
17 #include "chrome/browser/android/tab_android.h" | 19 #include "chrome/browser/android/tab_android.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 v2_pickle.WriteInt(policy_int); | 192 v2_pickle.WriteInt(policy_int); |
191 | 193 |
192 std::string original_request_url_spec; | 194 std::string original_request_url_spec; |
193 if (iterator->ReadString(&original_request_url_spec)) | 195 if (iterator->ReadString(&original_request_url_spec)) |
194 v2_pickle.WriteString(original_request_url_spec); | 196 v2_pickle.WriteString(original_request_url_spec); |
195 | 197 |
196 bool is_overriding_user_agent; | 198 bool is_overriding_user_agent; |
197 if (iterator->ReadBool(&is_overriding_user_agent)) | 199 if (iterator->ReadBool(&is_overriding_user_agent)) |
198 v2_pickle.WriteBool(is_overriding_user_agent); | 200 v2_pickle.WriteBool(is_overriding_user_agent); |
199 | 201 |
200 int64 timestamp_internal_value = 0; | 202 int64_t timestamp_internal_value = 0; |
201 if (iterator->ReadInt64(×tamp_internal_value)) | 203 if (iterator->ReadInt64(×tamp_internal_value)) |
202 v2_pickle.WriteInt64(timestamp_internal_value); | 204 v2_pickle.WriteInt64(timestamp_internal_value); |
203 | 205 |
204 // Force output of search_terms | 206 // Force output of search_terms |
205 v2_pickle.WriteString16(base::string16()); | 207 v2_pickle.WriteString16(base::string16()); |
206 | 208 |
207 base::PickleIterator tab_navigation_pickle_iterator(v2_pickle); | 209 base::PickleIterator tab_navigation_pickle_iterator(v2_pickle); |
208 sessions::SerializedNavigationEntry nav; | 210 sessions::SerializedNavigationEntry nav; |
209 if (nav.ReadFromPickle(&tab_navigation_pickle_iterator)) { | 211 if (nav.ReadFromPickle(&tab_navigation_pickle_iterator)) { |
210 navigations->push_back(nav); | 212 navigations->push_back(nav); |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 WebContentsState::RestoreContentsFromByteBuffer(env, clazz, state, | 573 WebContentsState::RestoreContentsFromByteBuffer(env, clazz, state, |
572 saved_state_version, true) | 574 saved_state_version, true) |
573 .obj())); | 575 .obj())); |
574 if (web_contents.get()) | 576 if (web_contents.get()) |
575 TabAndroid::CreateHistoricalTabFromContents(web_contents.get()); | 577 TabAndroid::CreateHistoricalTabFromContents(web_contents.get()); |
576 } | 578 } |
577 | 579 |
578 bool RegisterTabState(JNIEnv* env) { | 580 bool RegisterTabState(JNIEnv* env) { |
579 return RegisterNativesImpl(env); | 581 return RegisterNativesImpl(env); |
580 } | 582 } |
OLD | NEW |