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

Issue 10701043: Make ShortcutsBackend a ProfileKeyedService. (Closed)

Created:
8 years, 5 months ago by mrossetti
Modified:
8 years, 5 months ago
Reviewers:
Miranda Callahan
CC:
chromium-reviews, James Su, brettw-cc_chromium.org
Visibility:
Public.

Description

Make ShortcutsBackend a ProfileKeyedService. Removed all GetShortcutsBackend. Also minor enhancement of ShortcutsBackend unit tests to test shortcut update notifications. BUG=112558 TEST=All tests pass. Enhanced one test. TBR=sky Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=145378

Patch Set 1 #

Total comments: 6

Patch Set 2 : #

Total comments: 10

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+259 lines, -137 lines) Patch
M chrome/browser/autocomplete/shortcuts_provider.h View 1 2 1 chunk +2 lines, -6 lines 0 comments Download
M chrome/browser/autocomplete/shortcuts_provider.cc View 1 2 6 chunks +28 lines, -25 lines 0 comments Download
M chrome/browser/autocomplete/shortcuts_provider_unittest.cc View 1 9 chunks +31 lines, -37 lines 0 comments Download
M chrome/browser/history/shortcuts_backend.h View 1 4 chunks +9 lines, -4 lines 0 comments Download
M chrome/browser/history/shortcuts_backend.cc View 1 2 chunks +10 lines, -4 lines 0 comments Download
A chrome/browser/history/shortcuts_backend_factory.h View 1 2 1 chunk +52 lines, -0 lines 0 comments Download
A chrome/browser/history/shortcuts_backend_factory.cc View 1 1 chunk +71 lines, -0 lines 0 comments Download
M chrome/browser/history/shortcuts_backend_unittest.cc View 1 7 chunks +20 lines, -8 lines 0 comments Download
M chrome/browser/history/shortcuts_database.h View 1 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/history/shortcuts_database.cc View 1 9 chunks +21 lines, -23 lines 0 comments Download
M chrome/browser/history/shortcuts_database_unittest.cc View 1 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/profiles/off_the_record_profile_impl.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/profiles/off_the_record_profile_impl.cc View 1 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/profiles/profile.h View 1 1 chunk +0 lines, -5 lines 0 comments Download
M chrome/browser/profiles/profile_dependency_manager.cc View 1 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/chrome_constants.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_constants.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/base/testing_profile.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M chrome/test/base/testing_profile.cc View 1 2 chunks +2 lines, -4 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
mrossetti
Rachel, if you wouldn't mind taking a quick look at this to see if I've ...
8 years, 5 months ago (2012-06-29 19:06:13 UTC) #1
rpetterson
Will you be removing the instances of GetShortcutsBackend() in a later CL? Also, I have ...
8 years, 5 months ago (2012-06-29 20:57:06 UTC) #2
mrossetti
Addressed all issues. Removed all GetShortcutsBackend's. Tossing it back to you rpetterson for final review. ...
8 years, 5 months ago (2012-07-02 18:31:39 UTC) #3
mrossetti
Thanks for the assist!
8 years, 5 months ago (2012-07-03 14:53:58 UTC) #4
Miranda Callahan
A few questions -- here you go: https://chromiumcodereview.appspot.com/10701043/diff/12001/chrome/browser/autocomplete/shortcuts_provider.cc File chrome/browser/autocomplete/shortcuts_provider.cc (right): https://chromiumcodereview.appspot.com/10701043/diff/12001/chrome/browser/autocomplete/shortcuts_provider.cc#newcode273 chrome/browser/autocomplete/shortcuts_provider.cc:273: backend->shortcuts_map().end(); I ...
8 years, 5 months ago (2012-07-03 15:23:41 UTC) #5
mrossetti
Thanks for your eagle eye! Issues addressed. https://chromiumcodereview.appspot.com/10701043/diff/12001/chrome/browser/autocomplete/shortcuts_provider.cc File chrome/browser/autocomplete/shortcuts_provider.cc (right): https://chromiumcodereview.appspot.com/10701043/diff/12001/chrome/browser/autocomplete/shortcuts_provider.cc#newcode273 chrome/browser/autocomplete/shortcuts_provider.cc:273: backend->shortcuts_map().end(); On ...
8 years, 5 months ago (2012-07-03 16:42:29 UTC) #6
Miranda Callahan
8 years, 5 months ago (2012-07-03 17:41:26 UTC) #7
LGTM -- thanks!

On 2012/07/03 16:42:29, mzrossetti wrote:
> Thanks for your eagle eye!
> 
> Issues addressed.
> 
>
https://chromiumcodereview.appspot.com/10701043/diff/12001/chrome/browser/aut...
> File chrome/browser/autocomplete/shortcuts_provider.cc (right):
> 
>
https://chromiumcodereview.appspot.com/10701043/diff/12001/chrome/browser/aut...
> chrome/browser/autocomplete/shortcuts_provider.cc:273:
> backend->shortcuts_map().end();
> On 2012/07/03 15:23:41, Miranda Callahan wrote:
> > I am confused -- you check to see if the backend doesn't exist, and then
call
> > something from if if it doesn't? Should this just be a return?
> 
> Whoa! I don't know how this got overlooked. Fixed.
> 
>
https://chromiumcodereview.appspot.com/10701043/diff/12001/chrome/browser/his...
> File chrome/browser/history/shortcuts_backend.cc (right):
> 
>
https://chromiumcodereview.appspot.com/10701043/diff/12001/chrome/browser/his...
> chrome/browser/history/shortcuts_backend.cc:269:
> BrowserThread::CurrentlyOn(BrowserThread::UI));
> On 2012/07/03 15:23:41, Miranda Callahan wrote:
> > hmm, I am again confused -- is this really DCHECKing that the thread is
either
> > the UI thread or not the UI thread?
> 
> That is correct! ;^)
> 
> The IsWellKnownThread test takes care of the potentially strange threading
> environment while running a unit test when we don't really care if the thread
is
> actually the UI thread or not. When being run during normal browser operations
> this will insure that the function is only run on the proper thread.
> 
>
https://chromiumcodereview.appspot.com/10701043/diff/12001/chrome/browser/his...
> File chrome/browser/history/shortcuts_backend.h (right):
> 
>
https://chromiumcodereview.appspot.com/10701043/diff/12001/chrome/browser/his...
> chrome/browser/history/shortcuts_backend.h:75: // of the database, in which
case
> all operations are performed in memory only.
> On 2012/07/03 15:23:41, Miranda Callahan wrote:
> > Nice improvement of this comment. :-)
> 
> Thanks.
> 
>
https://chromiumcodereview.appspot.com/10701043/diff/12001/chrome/browser/his...
> File chrome/browser/history/shortcuts_backend_factory.h (right):
> 
>
https://chromiumcodereview.appspot.com/10701043/diff/12001/chrome/browser/his...
> chrome/browser/history/shortcuts_backend_factory.h:35: // Creates and returns
a
> backend but without creating its persistant database
> On 2012/07/03 15:23:41, Miranda Callahan wrote:
> > nit: s/persistant/persistent
> 
> Done.
> 
>
https://chromiumcodereview.appspot.com/10701043/diff/12001/chrome/browser/pro...
> File chrome/browser/profiles/profile_impl.cc (right):
> 
>
https://chromiumcodereview.appspot.com/10701043/diff/12001/chrome/browser/pro...
> chrome/browser/profiles/profile_impl.cc:45: #include
> "chrome/browser/history/shortcuts_backend_factory.h"
> On 2012/07/03 15:23:41, Miranda Callahan wrote:
> > does this need to be added?
> 
> No, removed.

Powered by Google App Engine
This is Rietveld 408576698