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

Issue 174484: Add a nullable string16 class to base. It combines a string16 + a null param... (Closed)

Created:
11 years, 4 months ago by jorlow
Modified:
9 years, 6 months ago
CC:
chromium-reviews_googlegroups.com, darin (slow to review), brettw, jam, Ben Goodger (Google)
Visibility:
Public.

Description

Add a nullable string16 class to base. It combines a string16 + a null param in order to cover all the possible states of a WebKit string. For strings where the null state is not meaninfully different from the empty state, this class should NOT be used. There are, however, some cases where we do need to track null. LocalStorage is an example. This class should be a fairly light weight way to do so. This change also adds implicit conversion to and from WebStrings. This also switches LocalStorage's IPCs over to using this new class. BUG=17343 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=24574

Patch Set 1 #

Total comments: 11

Patch Set 2 : '' #

Total comments: 4

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+113 lines, -40 lines) Patch
M base/base.gyp View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A base/nullable_string16.h View 1 1 chunk +28 lines, -0 lines 0 comments Download
M chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc View 1 2 3 chunks +5 lines, -7 lines 0 comments Download
M chrome/common/render_messages_internal.h View 1 2 2 chunks +5 lines, -8 lines 0 comments Download
M chrome/renderer/renderer_webstoragearea_impl.cc View 1 2 6 chunks +20 lines, -24 lines 0 comments Download
M ipc/ipc_message_utils.h View 2 2 chunks +27 lines, -0 lines 0 comments Download
M webkit/api/public/WebString.h View 1 2 2 chunks +26 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
darin (slow to review)
http://codereview.chromium.org/174484/diff/1/5 File base/nullable_string16.h (right): http://codereview.chromium.org/174484/diff/1/5#newcode10 Line 10: // In WebKit::WebStrings, being empty is distinguishable from ...
11 years, 4 months ago (2009-08-26 06:54:10 UTC) #1
jorlow
New patch uploaded. http://codereview.chromium.org/174484/diff/1/5 File base/nullable_string16.h (right): http://codereview.chromium.org/174484/diff/1/5#newcode10 Line 10: // In WebKit::WebStrings, being empty ...
11 years, 4 months ago (2009-08-26 08:42:03 UTC) #2
Mark Mentovai
LGTM Weird that this is a different codereview "issue" than the one I reviewed yesterday. ...
11 years, 4 months ago (2009-08-26 15:23:47 UTC) #3
darin (slow to review)
http://codereview.chromium.org/174484/diff/1013/1016 File chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc (right): http://codereview.chromium.org/174484/diff/1013/1016#newcode266 Line 266: const NullableString16 key = storage_area->key(index); const NullableString16& <- ...
11 years, 4 months ago (2009-08-26 16:29:28 UTC) #4
jorlow
11 years, 4 months ago (2009-08-26 17:04:49 UTC) #5
I decided that it'd be best if this CL included the changes to use
NullableString16 class.  Unfortunately, I had changes touching
render_messages_inernal.h already in that svn client, so I had to move it to
another.  Sorry.

http://codereview.chromium.org/174484/diff/1013/1016
File chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc (right):

http://codereview.chromium.org/174484/diff/1013/1016#newcode266
Line 266: const NullableString16 key = storage_area->key(index);
On 2009/08/26 16:29:29, darin wrote:
> const NullableString16& <- reference is key

Ohhh...gotcha.

http://codereview.chromium.org/174484/diff/1013/1021
File webkit/api/public/WebString.h (right):

http://codereview.chromium.org/174484/diff/1013/1021#newcode40
Line 40: #include <base/nullable_string16.h>
On 2009/08/26 15:23:48, Mark Mentovai wrote:
> Sort.

sorry

Powered by Google App Engine
This is Rietveld 408576698