Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(396)

Side by Side Diff: android_webview/native/state_serializer.cc

Issue 11415292: [Search] No longer reverting omnibox text on instant search (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix tests Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/state_serializer.h" 5 #include "android_webview/native/state_serializer.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/pickle.h" 10 #include "base/pickle.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 if (!pickle->WriteString(entry.GetBaseURLForDataURL().spec())) 158 if (!pickle->WriteString(entry.GetBaseURLForDataURL().spec()))
159 return false; 159 return false;
160 160
161 if (!pickle->WriteBool(static_cast<int>(entry.GetIsOverridingUserAgent()))) 161 if (!pickle->WriteBool(static_cast<int>(entry.GetIsOverridingUserAgent())))
162 return false; 162 return false;
163 163
164 if (!pickle->WriteInt64(entry.GetTimestamp().ToInternalValue())) 164 if (!pickle->WriteInt64(entry.GetTimestamp().ToInternalValue()))
165 return false; 165 return false;
166 166
167 if (!pickle->WriteString16(entry.GetSearchTerms()))
168 return false;
joth 2012/12/13 02:11:48 fwiw the java-side of the webview API has no way t
boliu 2012/12/13 02:26:46 Right, agree with joth here that android webview w
169
167 // Please update AW_STATE_VERSION if serialization format is changed. 170 // Please update AW_STATE_VERSION if serialization format is changed.
joth 2012/12/13 02:11:48 guess you didn't see this comment? Maybe put some
168 171
169 return true; 172 return true;
170 } 173 }
171 174
172 bool RestoreNavigationEntryFromPickle(PickleIterator* iterator, 175 bool RestoreNavigationEntryFromPickle(PickleIterator* iterator,
173 content::NavigationEntry* entry) { 176 content::NavigationEntry* entry) {
174 { 177 {
175 string url; 178 string url;
176 if (!iterator->ReadString(&url)) 179 if (!iterator->ReadString(&url))
177 return false; 180 return false;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 entry->SetIsOverridingUserAgent(is_overriding_user_agent); 245 entry->SetIsOverridingUserAgent(is_overriding_user_agent);
243 } 246 }
244 247
245 { 248 {
246 int64 timestamp; 249 int64 timestamp;
247 if (!iterator->ReadInt64(&timestamp)) 250 if (!iterator->ReadInt64(&timestamp))
248 return false; 251 return false;
249 entry->SetTimestamp(base::Time::FromInternalValue(timestamp)); 252 entry->SetTimestamp(base::Time::FromInternalValue(timestamp));
250 } 253 }
251 254
255 {
256 string16 search_terms;
257 if (!iterator->ReadString16(&search_terms))
258 search_terms = string16();
joth 2012/12/13 02:11:48 this doesn't make sense? you're modifying a local,
259 }
260
252 return true; 261 return true;
253 } 262 }
254 263
255 } // namespace internal 264 } // namespace internal
256 265
257 } // namespace android_webview 266 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/native/state_serializer_unittests.cc » ('j') | content/public/browser/navigation_entry.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698