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

Issue 16162003: Introduce content::PageState (again). (Closed)

Created:
7 years, 6 months ago by darin (slow to review)
Modified:
7 years ago
CC:
chromium-reviews, Avi (use Gerrit), creis+watch_chromium.org, jam, joi+watch-content_chromium.org, marja+watch_chromium.org, darin-cc_chromium.org, ajwong+watch_chromium.org, android-webview-reviews_chromium.org, jochen+watch_chromium.org
Visibility:
Public.

Description

Introduce content::PageState (again). This is a concrete class wrapping a string that contains the data of a serialized WebKit::WebHistoryItem class. Previously, we've just passed around these as strings, giving them names like "state", "content_state" or "history_state". It has been hard to identify all of the places in the code where these strings get passed around. A concrete class should make usage more apparent. Plus, instead of manipulating the strings using methods from webkit/glue/glue_serialize.h, we can just declare methods on the PageState class. This makes the code much cleaner. This first pass just implements PageState in terms of glue_serialize. It also adds content/public/renderer/history_item_serialization.h as the home for PageState to WebKit::WebHistoryItem conversion, which should ideally only be usable from the renderer process. (This bit is a step toward resolving bug 237243.) page_state.h declares operator==() to support DCHECK_EQ, which seems consistent with the idea of PageState being a replacement for std::string. I didn't want to litter tests with calls to PageState::ToEncodedData(). That would get cumbersome. Originally reviewed at: https://codereview.chromium.org/14985014 The only difference is that page_state.cc is now split into two pieces: page_state.cc and page_state_webkit.cc. The second holds the definition of all methods that depend on webkit/glue. That way code like Chrome Frame and the iOS port of Chromium can use PageState without pulling in a dependency on webkit/glue at link time. BUG=240426 R=brettw@chromium.org, grt@chromium.org, joth@chromium.org, tsepez@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=202678

Patch Set 1 #

Patch Set 2 : Split page_state.cc #

Patch Set 3 : Fix IOS build. #

Patch Set 4 : Rebase #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+524 lines, -980 lines) Patch
M android_webview/native/state_serializer.cc View 3 chunks +4 lines, -2 lines 2 comments Download
M android_webview/native/state_serializer_unittests.cc View 4 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/sessions/session_restore.cc View 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/sessions/session_service_unittest.cc View 5 chunks +18 lines, -31 lines 0 comments Download
M chrome/browser/sessions/session_types_unittest.cc View 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/tab_contents/render_view_context_menu.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/browser.h View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/browser.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/browser_commands.h View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/browser_commands.cc View 3 chunks +3 lines, -5 lines 0 comments Download
M components/sessions/serialized_navigation_entry.h View 3 chunks +3 lines, -2 lines 0 comments Download
M components/sessions/serialized_navigation_entry.cc View 7 chunks +14 lines, -13 lines 0 comments Download
M components/sessions/serialized_navigation_entry_test_helper.h View 2 chunks +3 lines, -2 lines 0 comments Download
M components/sessions/serialized_navigation_entry_test_helper.cc View 2 chunks +6 lines, -5 lines 0 comments Download
M components/sessions/serialized_navigation_entry_unittest.cc View 8 chunks +9 lines, -8 lines 0 comments Download
M content/browser/renderer_host/render_view_host_delegate.h View 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_view_host_impl.h View 3 chunks +3 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.cc View 4 chunks +7 lines, -9 lines 0 comments Download
M content/browser/renderer_host/test_render_view_host.cc View 4 chunks +12 lines, -27 lines 0 comments Download
M content/browser/web_contents/navigation_controller_impl.cc View 4 chunks +6 lines, -9 lines 0 comments Download
M content/browser/web_contents/navigation_controller_impl_unittest.cc View 20 chunks +19 lines, -19 lines 0 comments Download
M content/browser/web_contents/navigation_entry_impl.h View 3 chunks +4 lines, -3 lines 0 comments Download
M content/browser/web_contents/navigation_entry_impl.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M content/browser/web_contents/navigation_entry_impl_unittest.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M content/browser/web_contents/render_view_host_manager_unittest.cc View 2 chunks +1 line, -2 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 4 chunks +6 lines, -6 lines 0 comments Download
M content/browser/web_contents/web_contents_impl_unittest.cc View 4 chunks +11 lines, -12 lines 0 comments Download
M content/common/view_messages.h View 5 chunks +5 lines, -4 lines 0 comments Download
M content/content_common.gypi View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M content/content_renderer.gypi View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M content/public/browser/navigation_entry.h View 3 chunks +4 lines, -2 lines 2 comments Download
M content/public/browser/web_contents.h View 2 chunks +2 lines, -1 line 0 comments Download
M content/public/browser/web_contents_delegate.h View 2 chunks +2 lines, -1 line 0 comments Download
M content/public/browser/web_contents_delegate.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/public/common/common_param_traits.h View 2 chunks +9 lines, -0 lines 0 comments Download
M content/public/common/common_param_traits.cc View 2 chunks +22 lines, -0 lines 0 comments Download
M content/public/common/context_menu_params.h View 2 chunks +3 lines, -3 lines 0 comments Download
A content/public/common/page_state.h View 1 chunk +66 lines, -0 lines 0 comments Download
A content/public/common/page_state.cc View 1 1 chunk +36 lines, -0 lines 0 comments Download
A content/public/common/page_state_ios.cc View 1 1 chunk +43 lines, -0 lines 0 comments Download
A content/public/common/page_state_webkit.cc View 1 1 chunk +59 lines, -0 lines 0 comments Download
A content/public/renderer/history_item_serialization.h View 1 chunk +26 lines, -0 lines 0 comments Download
A content/public/renderer/history_item_serialization.cc View 1 chunk +21 lines, -0 lines 0 comments Download
M content/public/test/render_view_fake_resources_test.cc View 3 chunks +2 lines, -2 lines 0 comments Download
M content/public/test/render_view_test.cc View 3 chunks +2 lines, -2 lines 0 comments Download
M content/renderer/context_menu_params_builder.cc View 2 chunks +3 lines, -5 lines 0 comments Download
M content/renderer/render_view_browsertest.cc View 20 chunks +21 lines, -21 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 7 chunks +11 lines, -12 lines 0 comments Download
M content/shell/common/shell_messages.h View 2 chunks +2 lines, -1 line 0 comments Download
M content/shell/renderer/webkit_test_runner.h View 3 chunks +3 lines, -2 lines 0 comments Download
M content/shell/renderer/webkit_test_runner.cc View 4 chunks +3 lines, -3 lines 0 comments Download
M content/shell/webkit_test_controller.cc View 3 chunks +6 lines, -7 lines 0 comments Download
M content/test/test_web_contents.cc View 2 chunks +2 lines, -2 lines 0 comments Download
D webkit/glue/glue_serialize.h View 1 chunk +0 lines, -57 lines 0 comments Download
D webkit/glue/glue_serialize.cc View 1 chunk +0 lines, -668 lines 0 comments Download
A + webkit/glue/glue_serialize_deprecated.h View 0 chunks +-1 lines, --1 lines 0 comments Download
A + webkit/glue/glue_serialize_deprecated.cc View 1 chunk +1 line, -1 line 0 comments Download
M webkit/glue/glue_serialize_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M webkit/glue/webkit_glue.gypi View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
grt (UTC plus 2)
lgtm regarding the size of npchrome_frame.dll.
7 years, 6 months ago (2013-05-28 20:01:22 UTC) #1
brettw
lgtm
7 years, 6 months ago (2013-05-28 21:08:10 UTC) #2
joth
https://codereview.chromium.org/16162003/diff/13001/android_webview/native/state_serializer.cc File android_webview/native/state_serializer.cc (right): https://codereview.chromium.org/16162003/diff/13001/android_webview/native/state_serializer.cc#newcode150 android_webview/native/state_serializer.cc:150: if (!pickle->WriteString(entry.GetPageState().ToEncodedData())) does the alter the format it is ...
7 years, 6 months ago (2013-05-28 22:04:34 UTC) #3
darin (slow to review)
On 2013/05/28 22:04:34, joth wrote: > https://codereview.chromium.org/16162003/diff/13001/android_webview/native/state_serializer.cc > File android_webview/native/state_serializer.cc (right): > > https://codereview.chromium.org/16162003/diff/13001/android_webview/native/state_serializer.cc#newcode150 > ...
7 years, 6 months ago (2013-05-28 22:47:01 UTC) #4
joth
aw/ lgtm Thanks darin!
7 years, 6 months ago (2013-05-28 22:48:45 UTC) #5
Tom Sepez
LGTM messages.
7 years, 6 months ago (2013-05-28 22:48:49 UTC) #6
darin (slow to review)
Committed patchset #4 manually as r202678 (presubmit successful).
7 years, 6 months ago (2013-05-28 22:52:10 UTC) #7
joth
https://codereview.chromium.org/16162003/diff/13001/android_webview/native/state_serializer.cc File android_webview/native/state_serializer.cc (right): https://codereview.chromium.org/16162003/diff/13001/android_webview/native/state_serializer.cc#newcode216 android_webview/native/state_serializer.cc:216: content::PageState::CreateFromEncodedData(content_state)); latent question.... what if |content_state| is bogus and ...
7 years, 6 months ago (2013-05-28 22:59:44 UTC) #8
darin (slow to review)
On 2013/05/28 22:59:44, joth wrote: > https://codereview.chromium.org/16162003/diff/13001/android_webview/native/state_serializer.cc > File android_webview/native/state_serializer.cc (right): > > https://codereview.chromium.org/16162003/diff/13001/android_webview/native/state_serializer.cc#newcode216 > ...
7 years, 6 months ago (2013-05-28 23:04:13 UTC) #9
joth
to summarize offline chat: this data is only handed over as an opaque blob and ...
7 years, 6 months ago (2013-05-28 23:24:17 UTC) #10
joth
(question on historic CL) https://codereview.chromium.org/16162003/diff/13001/content/public/browser/navigation_entry.h File content/public/browser/navigation_entry.h (right): https://codereview.chromium.org/16162003/diff/13001/content/public/browser/navigation_entry.h#newcode79 content/public/browser/navigation_entry.h:79: // XXX Just to check, ...
7 years ago (2013-11-26 00:46:08 UTC) #11
darin (slow to review)
https://codereview.chromium.org/16162003/diff/13001/content/public/browser/navigation_entry.h File content/public/browser/navigation_entry.h (right): https://codereview.chromium.org/16162003/diff/13001/content/public/browser/navigation_entry.h#newcode79 content/public/browser/navigation_entry.h:79: // XXX On 2013/11/26 00:46:09, joth wrote: > Just ...
7 years ago (2013-11-26 05:36:41 UTC) #12
darin (slow to review)
Here: https://codereview.chromium.org/87343002/ On Mon, Nov 25, 2013 at 9:36 PM, <darin@chromium.org> wrote: > > https://codereview.chromium.org/16162003/diff/13001/ ...
7 years ago (2013-11-26 05:47:19 UTC) #13
joth
7 years ago (2013-11-26 19:03:25 UTC) #14
Got it. Thanks!



On 25 November 2013 21:47, Darin Fisher <darin@chromium.org> wrote:

> Here: https://codereview.chromium.org/87343002/
>
>
> On Mon, Nov 25, 2013 at 9:36 PM, <darin@chromium.org> wrote:
>
>>
>> https://codereview.chromium.org/16162003/diff/13001/
>> content/public/browser/navigation_entry.h
>> File content/public/browser/navigation_entry.h (right):
>>
>> https://codereview.chromium.org/16162003/diff/13001/
>> content/public/browser/navigation_entry.h#newcode79
>> content/public/browser/navigation_entry.h:79: // XXX
>> On 2013/11/26 00:46:09, joth wrote:
>>
>>> Just to check, was this XXX indicating something important? (I propose
>>>
>>  to
>>
>>> remove it in https://codereview.chromium.org/84703003 else...)
>>>
>>
>> Whoops, that was not supposed to be committed. It was a reminder to me
>> to revise this comment block. Where it says "content state", it should
>> instead say "page state." I'll write a patch for that.
>>
>> https://codereview.chromium.org/16162003/
>>
>
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698