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

Issue 6306011: Remove wstring from autocomplete. (Closed)

Created:
9 years, 11 months ago by Avi (use Gerrit)
Modified:
9 years, 7 months ago
Reviewers:
James Su, Evan Martin, evanm
CC:
chromium-reviews, Aaron Boodman, Erik does not do reviews, pam+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Remove wstring from autocomplete. Recommit of r72380. BUG=23581 TEST=no visible changes; all tests pass Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=72492

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 2

Patch Set 3 : '' #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+1313 lines, -1211 lines) Patch
M chrome/browser/autocomplete/autocomplete.h View 1 12 chunks +26 lines, -25 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete.cc View 1 18 chunks +55 lines, -48 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_accessibility.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/autocomplete/autocomplete_browsertest.cc View 1 12 chunks +37 lines, -34 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_classifier.h View 1 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_classifier.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit.h View 1 20 chunks +30 lines, -30 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit.cc View 1 28 chunks +44 lines, -44 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_unittest.cc View 1 7 chunks +30 lines, -29 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view.h View 1 6 chunks +12 lines, -12 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view_browsertest.cc View 1 24 chunks +48 lines, -45 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view_gtk.h View 1 6 chunks +15 lines, -15 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc View 1 21 chunks +33 lines, -34 lines 1 comment Download
M chrome/browser/autocomplete/autocomplete_edit_view_mac.h View 1 5 chunks +16 lines, -16 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view_mac.mm View 1 20 chunks +33 lines, -33 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view_mac_unittest.mm View 1 4 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view_views.h View 1 4 chunks +14 lines, -14 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view_views.cc View 1 11 chunks +21 lines, -21 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view_win.h View 1 9 chunks +20 lines, -20 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view_win.cc View 1 24 chunks +36 lines, -36 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_match.h View 1 4 chunks +7 lines, -7 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_match.cc View 1 5 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_popup_model.h View 1 2 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_popup_model.cc View 1 5 chunks +11 lines, -11 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_popup_view_gtk.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc View 1 4 chunks +11 lines, -11 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_popup_view_gtk_unittest.cc View 1 7 chunks +7 lines, -6 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_popup_view_mac.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_popup_view_mac.mm View 1 5 chunks +7 lines, -8 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_popup_view_mac_unittest.mm View 1 12 chunks +23 lines, -25 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_unittest.cc View 1 11 chunks +118 lines, -113 lines 0 comments Download
M chrome/browser/autocomplete/history_contents_provider.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/autocomplete/history_contents_provider.cc View 1 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/autocomplete/history_contents_provider_unittest.cc View 1 5 chunks +23 lines, -19 lines 0 comments Download
M chrome/browser/autocomplete/history_provider.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/autocomplete/history_provider.cc View 1 5 chunks +18 lines, -15 lines 0 comments Download
M chrome/browser/autocomplete/history_provider_util.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/autocomplete/history_provider_util.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/autocomplete/history_quick_provider.cc View 1 3 chunks +14 lines, -15 lines 0 comments Download
M chrome/browser/autocomplete/history_quick_provider_unittest.cc View 1 6 chunks +7 lines, -7 lines 0 comments Download
M chrome/browser/autocomplete/history_url_provider.h View 1 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/autocomplete/history_url_provider.cc View 1 14 chunks +36 lines, -35 lines 0 comments Download
M chrome/browser/autocomplete/history_url_provider_unittest.cc View 1 14 chunks +59 lines, -52 lines 0 comments Download
M chrome/browser/autocomplete/keyword_provider.h View 1 4 chunks +11 lines, -11 lines 0 comments Download
M chrome/browser/autocomplete/keyword_provider.cc View 1 19 chunks +46 lines, -50 lines 0 comments Download
M chrome/browser/autocomplete/keyword_provider_unittest.cc View 1 4 chunks +71 lines, -56 lines 0 comments Download
M chrome/browser/autocomplete/search_provider.h View 1 7 chunks +12 lines, -12 lines 0 comments Download
M chrome/browser/autocomplete/search_provider.cc View 1 21 chunks +41 lines, -42 lines 0 comments Download
M chrome/browser/autocomplete/search_provider_unittest.cc View 1 4 chunks +5 lines, -6 lines 0 comments Download
chrome/browser/automation/testing_automation_provider.h View 1 2 chunks +4 lines, -4 lines 0 comments Download
chrome/browser/automation/testing_automation_provider.cc View 1 15 chunks +46 lines, -46 lines 0 comments Download
MM chrome/browser/extensions/extension_omnibox_api.cc View 1 1 chunk +1 line, -1 line 0 comments Download
MM chrome/browser/extensions/extension_omnibox_apitest.cc View 1 6 chunks +22 lines, -17 lines 0 comments Download
MM chrome/browser/instant/instant_browsertest.cc View 1 9 chunks +9 lines, -9 lines 0 comments Download
MM chrome/browser/net/url_fixer_upper.h View 1 2 chunks +5 lines, -1 line 0 comments Download
MM chrome/browser/net/url_fixer_upper.cc View 1 2 chunks +54 lines, -0 lines 0 comments Download
MM chrome/browser/omnibox_search_hint.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
MM chrome/browser/tab_contents/render_view_context_menu.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
MM chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm View 1 1 chunk +1 line, -1 line 0 comments Download
MM chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h View 1 2 chunks +3 lines, -3 lines 0 comments Download
MM chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm View 1 6 chunks +13 lines, -15 lines 0 comments Download
MM chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.h View 1 2 chunks +2 lines, -1 line 0 comments Download
MM chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm View 1 1 chunk +5 lines, -5 lines 0 comments Download
MM chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration_unittest.mm View 1 2 chunks +2 lines, -1 line 0 comments Download
MM chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm View 1 1 chunk +1 line, -2 lines 0 comments Download
MM chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm View 1 1 chunk +1 line, -2 lines 0 comments Download
MM chrome/browser/ui/gtk/gtk_util.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
MM chrome/browser/ui/gtk/location_bar_view_gtk.h View 1 4 chunks +5 lines, -5 lines 0 comments Download
MM chrome/browser/ui/gtk/location_bar_view_gtk.cc View 1 11 chunks +16 lines, -18 lines 0 comments Download
M chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
MM chrome/browser/ui/toolbar/toolbar_model.cc View 1 1 chunk +5 lines, -3 lines 0 comments Download
MM chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc View 1 12 chunks +15 lines, -17 lines 0 comments Download
MM chrome/browser/ui/views/frame/browser_root_view.cc View 1 1 chunk +1 line, -1 line 0 comments Download
MM chrome/browser/ui/views/location_bar/keyword_hint_view.h View 1 2 chunks +3 lines, -3 lines 0 comments Download
MM chrome/browser/ui/views/location_bar/keyword_hint_view.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
MM chrome/browser/ui/views/location_bar/location_bar_view.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
MM chrome/browser/ui/views/location_bar/location_bar_view.cc View 1 6 chunks +12 lines, -13 lines 0 comments Download
MM chrome/browser/ui/views/location_bar/selected_keyword_view.h View 1 2 chunks +3 lines, -3 lines 0 comments Download
MM chrome/browser/ui/views/location_bar/selected_keyword_view.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
MM chrome/common/automation_messages_internal.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
MM chrome/test/automation/autocomplete_edit_proxy.h View 1 4 chunks +11 lines, -11 lines 0 comments Download
MM chrome/test/automation/autocomplete_edit_proxy.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
chrome/test/automation/automation_proxy_uitest.cc View 1 5 chunks +10 lines, -8 lines 0 comments Download
MM chrome/test/ui/omnibox_uitest.cc View 1 3 chunks +12 lines, -10 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Avi (use Gerrit)
Same as before, change in extensions/extension_omnibox_apitest.cc and autocomplete/autocomplete_browsertest.cc to use the size_t modifier.
9 years, 11 months ago (2011-01-24 22:08:54 UTC) #1
evanm
LGTM++ http://codereview.chromium.org/6306011/diff/4001/chrome/browser/extensions/extension_omnibox_apitest.cc File chrome/browser/extensions/extension_omnibox_apitest.cc (left): http://codereview.chromium.org/6306011/diff/4001/chrome/browser/extensions/extension_omnibox_apitest.cc#oldcode35 chrome/browser/extensions/extension_omnibox_apitest.cc:35: std::wstring output(base::StringPrintf(L"{%d} ", result.size())); whaaa, the old code ...
9 years, 11 months ago (2011-01-24 22:10:25 UTC) #2
Avi (use Gerrit)
http://codereview.chromium.org/6306011/diff/4001/chrome/browser/extensions/extension_omnibox_apitest.cc File chrome/browser/extensions/extension_omnibox_apitest.cc (left): http://codereview.chromium.org/6306011/diff/4001/chrome/browser/extensions/extension_omnibox_apitest.cc#oldcode35 chrome/browser/extensions/extension_omnibox_apitest.cc:35: std::wstring output(base::StringPrintf(L"{%d} ", result.size())); Yeah, dunno why. Too bad ...
9 years, 11 months ago (2011-01-24 22:12:56 UTC) #3
James Su
http://codereview.chromium.org/6306011/diff/56002/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc File chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc (right): http://codereview.chromium.org/6306011/diff/56002/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc#newcode1436 chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc:1436: string16 text_wstr = UTF8ToUTF16(text); This line causes crash when ...
9 years, 11 months ago (2011-01-26 01:42:05 UTC) #4
Avi (use Gerrit)
That inconsistency between UTF8ToUTF16 and UTF8ToWide is really troubling. Those are really very different semantics ...
9 years, 11 months ago (2011-01-26 04:56:34 UTC) #5
James Su
On 2011/01/26 04:56:34, Avi wrote: > That inconsistency between UTF8ToUTF16 and UTF8ToWide is really troubling. ...
9 years, 11 months ago (2011-01-26 05:13:41 UTC) #6
Avi (use Gerrit)
That's a really good question. Can we DCHECK on a StringPiece construction from null? Is ...
9 years, 11 months ago (2011-01-26 14:53:40 UTC) #7
Avi (use Gerrit)
Looking, StringPiece construction from NULL seems to be an explicit feature. Avi On Wed, Jan ...
9 years, 11 months ago (2011-01-26 14:56:22 UTC) #8
James Su
I suggest to patch UTF8ToUTF16 to accept const StringPiece& instead of const std::string&. On 2011/01/26 ...
9 years, 11 months ago (2011-01-26 20:01:38 UTC) #9
evanm
9 years, 11 months ago (2011-01-26 20:08:05 UTC) #10
Yeah, that saves copying the char data when calling
  UTF8ToUTF16("foo")
(which would otherwise create a std::string)

On Wed, Jan 26, 2011 at 12:01 PM,  <suzhe@chromium.org> wrote:
> I suggest to patch UTF8ToUTF16 to accept const StringPiece& instead of const
> std::string&.
>
> On 2011/01/26 14:56:22, Avi wrote:
>>
>> Looking, StringPiece construction from NULL seems to be an explicit
>> feature.
>
>> Avi
>
>> On Wed, Jan 26, 2011 at 9:53 AM, Avi Drissman <mailto:avi@chromium.org>
>> wrote:
>
>> > That's a really good question. Can we DCHECK on a StringPiece
>> > construction
>> > from null? Is that something we want to disallow?
>> >
>> > Avi
>> >
>> >
>> > On Wed, Jan 26, 2011 at 12:13 AM, <mailto:suzhe@chromium.org> wrote:
>> >
>> >> On 2011/01/26 04:56:34, Avi wrote:
>> >>
>> >>> That inconsistency between UTF8ToUTF16 and UTF8ToWide is really
>> >>> troubling.
>> >>> Those are really very different semantics for two similarly named
>> >>> functions
>> >>> to have and I can't be the only one who's been bitten.
>> >>>
>> >>
>> >>  std::wstring UTF8ToWide(const base::StringPiece& utf8);
>> >>> string16 UTF8ToUTF16(const std::string& utf8);
>> >>>
>> >>
>> >>  So StringPiece can construct from null? Ew. Given that these are const
>> >>> references, I wouldn't think that it would be a good idea to rely on
>> >>> the
>> >>> null thing, and that seems like a latent bug in
>> >>> the autocomplete_edit_view_gtk code that was exposed by the
>> >>> conversion.
>> >>>
>> >> Yes. We need to fix autocomplete_edit_view_gtk. I'm just wondering if
>> >> there are
>> >> other similar hidden bugs yet to be discovered.
>> >>
>> >>
>> >>  Avi
>> >>>
>> >>
>> >>  On Tue, Jan 25, 2011 at 8:42 PM, <mailto:suzhe@chromium.org> wrote:
>> >>>
>> >>
>> >>  >
>> >>> >
>> >>> >
>> >>>
>> >>
>> >>
>> >>
>
>
http://codereview.chromium.org/6306011/diff/56002/chrome/browser/autocomplete...
>>
>> >>
>> >>> > File chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
>> >>> > (right):
>> >>> >
>> >>> >
>> >>> >
>> >>>
>> >>
>> >>
>> >>
>
>
http://codereview.chromium.org/6306011/diff/56002/chrome/browser/autocomplete...
>>
>> >>
>> >>> > chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc:1436:
>> >>> string16
>> >>> > text_wstr = UTF8ToUTF16(text);
>> >>> > This line causes crash when text is NULL. As UTF8ToUTF16() only
>> >>> > accepts
>> >>> > std::string, which doesn't like NULL pointer at all. While
>> >>> > UTF8ToWide()
>> >>> > accepts StringPiece, which is ok for NULL.
>> >>> > We need to care about such difference when migrating from wstring to
>> >>> > string16.
>> >>> >
>> >>> >
>> >>> > http://codereview.chromium.org/6306011/
>> >>> >
>> >>>
>> >>
>> >>
>> >>
>> >> http://codereview.chromium.org/6306011/
>> >>
>> >
>> >
>
>
>
> http://codereview.chromium.org/6306011/
>

Powered by Google App Engine
This is Rietveld 408576698