OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/sessions/base_session_service.h" | 5 #include "chrome/browser/sessions/base_session_service.h" |
6 | 6 |
7 #include "base/pickle.h" | 7 #include "base/pickle.h" |
8 #include "base/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // Bound the string data (which is variable length) to | 151 // Bound the string data (which is variable length) to |
152 // |max_state_size bytes| bytes. | 152 // |max_state_size bytes| bytes. |
153 static const SessionCommand::size_type max_state_size = | 153 static const SessionCommand::size_type max_state_size = |
154 std::numeric_limits<SessionCommand::size_type>::max() - 1024; | 154 std::numeric_limits<SessionCommand::size_type>::max() - 1024; |
155 | 155 |
156 int bytes_written = 0; | 156 int bytes_written = 0; |
157 | 157 |
158 WriteStringToPickle(pickle, &bytes_written, max_state_size, | 158 WriteStringToPickle(pickle, &bytes_written, max_state_size, |
159 entry.virtual_url().spec()); | 159 entry.virtual_url().spec()); |
160 | 160 |
161 // TODO(evan): use directionality of title. | 161 WriteString16ToPickle(pickle, &bytes_written, max_state_size, entry.title()); |
162 // http://code.google.com/p/chromium/issues/detail?id=27094 | |
163 WriteString16ToPickle(pickle, &bytes_written, max_state_size, | |
164 entry.title().string()); | |
165 | 162 |
166 if (entry.has_post_data()) { | 163 if (entry.has_post_data()) { |
167 // Remove the form data, it may contain sensitive information. | 164 // Remove the form data, it may contain sensitive information. |
168 WriteStringToPickle(pickle, &bytes_written, max_state_size, | 165 WriteStringToPickle(pickle, &bytes_written, max_state_size, |
169 webkit_glue::RemoveFormDataFromHistoryState(entry.content_state())); | 166 webkit_glue::RemoveFormDataFromHistoryState(entry.content_state())); |
170 } else { | 167 } else { |
171 WriteStringToPickle(pickle, &bytes_written, max_state_size, | 168 WriteStringToPickle(pickle, &bytes_written, max_state_size, |
172 entry.content_state()); | 169 entry.content_state()); |
173 } | 170 } |
174 | 171 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 if (backend_thread()) { | 277 if (backend_thread()) { |
281 backend_thread()->message_loop()->PostTask(FROM_HERE, | 278 backend_thread()->message_loop()->PostTask(FROM_HERE, |
282 NewRunnableMethod(backend(), | 279 NewRunnableMethod(backend(), |
283 &SessionBackend::ReadCurrentSessionCommands, | 280 &SessionBackend::ReadCurrentSessionCommands, |
284 request_wrapper)); | 281 request_wrapper)); |
285 } else { | 282 } else { |
286 backend()->ReadCurrentSessionCommands(request); | 283 backend()->ReadCurrentSessionCommands(request); |
287 } | 284 } |
288 return request->handle(); | 285 return request->handle(); |
289 } | 286 } |
OLD | NEW |