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

Issue 12498002: InstantExtended: Adding InstantRestrictedIDCache. (Closed)

Created:
7 years, 9 months ago by Shishir
Modified:
7 years, 9 months ago
Reviewers:
palmer, brettw, sreeram, dhollowa
CC:
chromium-reviews, melevin, gideonwald, dominich, Aaron Boodman, David Black, samarth+watch_chromium.org, chromium-apps-reviews_chromium.org, darin-cc_chromium.org, Jered
Visibility:
Public.

Description

InstantExtended: Adding InstantRestrictedIDCache for caching and looking up restricted IDs. In InstantExtended, cross origin iframes are used to display objects which can only be referenced by the Instant page using an ID (restricted ID). These IDs need to be unique and and cached for a while so that the SearchBox API can fetch the object info based on the ID. The reason to use a cache of N items as against just the last set of results is that there may be race conditions between the internal state of the SearchBox and the data being displayed. This CL introduces a template class InstantRestrictedIDCache that can be used to generate the restricted IDs for objects, cache them and fetch objects based on the IDs. BUG=181870 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=190052

Patch Set 1 #

Total comments: 32

Patch Set 2 : Adding new API to add items with restricted ID assigned. #

Patch Set 3 : Merging David's and Sreeram's changes. #

Total comments: 69

Patch Set 4 : Addressing chris's and david's comments. #

Total comments: 26

Patch Set 5 : Addressing sreeram's comments. #

Patch Set 6 : Merging conflicts. #

Total comments: 12

Patch Set 7 : Adding test and addressing comments.wq #

Patch Set 8 : Minor test fix. #

Total comments: 2

Patch Set 9 : Using MRUCache to implement InstantRestrcitedIDCache. #

Total comments: 6

Patch Set 10 : Addressing chris's comments. #

Patch Set 11 : Rebasing for commit. #

Patch Set 12 : Fixing android compile error. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+758 lines, -317 lines) Patch
M chrome/browser/search/instant_io_context.h View 1 2 3 4 5 3 chunks +13 lines, -18 lines 0 comments Download
M chrome/browser/search/instant_io_context.cc View 1 2 3 4 5 6 5 chunks +16 lines, -29 lines 0 comments Download
M chrome/browser/search/instant_service.h View 1 2 3 4 5 6 3 chunks +17 lines, -21 lines 0 comments Download
M chrome/browser/search/instant_service.cc View 1 2 3 4 5 6 7 8 9 10 7 chunks +34 lines, -102 lines 0 comments Download
M chrome/browser/ui/search/instant_controller.h View 1 2 3 4 5 2 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/ui/search/instant_controller.cc View 1 2 3 4 5 6 7 8 9 3 chunks +26 lines, -21 lines 0 comments Download
M chrome/browser/ui/search/instant_extended_browsertest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/search/instant_page.h View 1 2 3 4 5 3 chunks +8 lines, -5 lines 0 comments Download
M chrome/browser/ui/search/instant_page.cc View 1 2 3 4 5 2 chunks +5 lines, -5 lines 0 comments Download
M chrome/chrome_common.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
A chrome/common/instant_restricted_id_cache.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +149 lines, -0 lines 0 comments Download
A chrome/common/instant_restricted_id_cache_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +348 lines, -0 lines 0 comments Download
M chrome/common/instant_types.h View 1 2 3 4 5 6 7 8 9 4 chunks +16 lines, -5 lines 0 comments Download
M chrome/common/render_messages.h View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/renderer/searchbox/searchbox.h View 1 2 3 4 5 6 6 chunks +37 lines, -23 lines 0 comments Download
M chrome/renderer/searchbox/searchbox.cc View 1 2 3 4 5 6 7 chunks +33 lines, -30 lines 0 comments Download
M chrome/renderer/searchbox/searchbox_extension.cc View 1 2 3 4 5 6 7 8 9 8 chunks +44 lines, -50 lines 0 comments Download

Messages

Total messages: 37 (0 generated)
Shishir
PTAL
7 years, 9 months ago (2013-03-05 23:24:26 UTC) #1
dhollowa
https://codereview.chromium.org/12498002/diff/1/chrome/common/instant_restricted_id_cache.h File chrome/common/instant_restricted_id_cache.h (right): https://codereview.chromium.org/12498002/diff/1/chrome/common/instant_restricted_id_cache.h#newcode18 chrome/common/instant_restricted_id_cache.h:18: // T needs to be copyable. nit: Please add ...
7 years, 9 months ago (2013-03-06 02:12:58 UTC) #2
sreeram
Last week when we discussed this, I forgot that, for most visited items, while we ...
7 years, 9 months ago (2013-03-11 18:48:08 UTC) #3
sreeram
On 2013/03/11 18:48:08, sreeram wrote: > void GetCurrentItems(std::vector<RestrictedIDItemPair>*); Should be const: void GetCurrentItems(std::vector<RestrictedIDItemPair>*) const;
7 years, 9 months ago (2013-03-11 18:48:50 UTC) #4
sreeram
For implementation, I suggest that we store a sorted list (or vector or whatever) of ...
7 years, 9 months ago (2013-03-11 18:58:07 UTC) #5
sreeram
On 2013/03/11 18:58:07, sreeram wrote: > For implementation, I suggest that we store a sorted ...
7 years, 9 months ago (2013-03-11 20:40:54 UTC) #6
Shishir
Made API changes as per discussion. Also addressed David's comments. PTAL. https://codereview.chromium.org/12498002/diff/1/chrome/common/instant_restricted_id_cache.h File chrome/common/instant_restricted_id_cache.h (right): ...
7 years, 9 months ago (2013-03-11 21:07:24 UTC) #7
Shishir
Merged all RID generation/lookup into this CL. PTAL.
7 years, 9 months ago (2013-03-13 00:51:10 UTC) #8
palmer
https://codereview.chromium.org/12498002/diff/14001/chrome/browser/instant/instant_io_context.cc File chrome/browser/instant/instant_io_context.cc (right): https://codereview.chromium.org/12498002/diff/14001/chrome/browser/instant/instant_io_context.cc#newcode18 chrome/browser/instant/instant_io_context.cc:18: const int kMostVisitedItemCacheSize = 1000; You define this in ...
7 years, 9 months ago (2013-03-13 23:50:37 UTC) #9
dhollowa
https://codereview.chromium.org/12498002/diff/14001/chrome/browser/instant/instant_controller.cc File chrome/browser/instant/instant_controller.cc (right): https://codereview.chromium.org/12498002/diff/14001/chrome/browser/instant/instant_controller.cc#newcode201 chrome/browser/instant/instant_controller.cc:201: InstantRestrictedID restricted_id, Keep |most_visited_item_id|. https://codereview.chromium.org/12498002/diff/14001/chrome/browser/instant/instant_controller.cc#newcode890 chrome/browser/instant/instant_controller.cc:890: InstantRestrictedID restricted_id) { ...
7 years, 9 months ago (2013-03-14 00:02:43 UTC) #10
Shishir
PTAL https://codereview.chromium.org/12498002/diff/14001/chrome/browser/instant/instant_controller.cc File chrome/browser/instant/instant_controller.cc (right): https://codereview.chromium.org/12498002/diff/14001/chrome/browser/instant/instant_controller.cc#newcode201 chrome/browser/instant/instant_controller.cc:201: InstantRestrictedID restricted_id, On 2013/03/14 00:02:43, dhollowa wrote: > ...
7 years, 9 months ago (2013-03-14 19:53:03 UTC) #11
sreeram
https://codereview.chromium.org/12498002/diff/27001/chrome/chrome_common.gypi File chrome/chrome_common.gypi (right): https://codereview.chromium.org/12498002/diff/27001/chrome/chrome_common.gypi#newcode285 chrome/chrome_common.gypi:285: 'chrome/common/instant_restricted_id_cache.h', Remove "chrome/" from the path. https://codereview.chromium.org/12498002/diff/27001/chrome/common/instant_restricted_id_cache.h File chrome/common/instant_restricted_id_cache.h ...
7 years, 9 months ago (2013-03-14 23:05:35 UTC) #12
dhollowa
lgtm https://codereview.chromium.org/12498002/diff/14001/chrome/browser/instant/instant_io_context.cc File chrome/browser/instant/instant_io_context.cc (right): https://codereview.chromium.org/12498002/diff/14001/chrome/browser/instant/instant_io_context.cc#newcode18 chrome/browser/instant/instant_io_context.cc:18: const int kMostVisitedItemCacheSize = 1000; On 2013/03/14 19:53:03, ...
7 years, 9 months ago (2013-03-14 23:40:00 UTC) #13
palmer
https://codereview.chromium.org/12498002/diff/14001/chrome/common/instant_types.h File chrome/common/instant_types.h (right): https://codereview.chromium.org/12498002/diff/14001/chrome/common/instant_types.h#newcode16 chrome/common/instant_types.h:16: typedef int InstantRestrictedID; > > // NOTE: unsigned types ...
7 years, 9 months ago (2013-03-15 01:47:52 UTC) #14
Shishir
PTAL. https://codereview.chromium.org/12498002/diff/14001/chrome/common/instant_types.h File chrome/common/instant_types.h (right): https://codereview.chromium.org/12498002/diff/14001/chrome/common/instant_types.h#newcode16 chrome/common/instant_types.h:16: typedef int InstantRestrictedID; On 2013/03/15 01:47:53, Chris P. ...
7 years, 9 months ago (2013-03-15 17:31:15 UTC) #15
Shishir
Friendly ping. This will block my iframes CL.
7 years, 9 months ago (2013-03-19 19:16:18 UTC) #16
sreeram
On 2013/03/19 19:16:18, Shishir wrote: > Friendly ping. This will block my iframes CL. Reviewing ...
7 years, 9 months ago (2013-03-19 21:02:39 UTC) #17
sreeram
lgtm https://codereview.chromium.org/12498002/diff/46001/chrome/browser/search/instant_io_context.cc File chrome/browser/search/instant_io_context.cc (right): https://codereview.chromium.org/12498002/diff/46001/chrome/browser/search/instant_io_context.cc#newcode18 chrome/browser/search/instant_io_context.cc:18: const int kMostVisitedItemCacheSize = 100; Not being used. ...
7 years, 9 months ago (2013-03-19 21:36:16 UTC) #18
palmer
https://codereview.chromium.org/12498002/diff/46001/chrome/common/instant_restricted_id_cache_unittest.cc File chrome/common/instant_restricted_id_cache_unittest.cc (right): https://codereview.chromium.org/12498002/diff/46001/chrome/common/instant_restricted_id_cache_unittest.cc#newcode246 chrome/common/instant_restricted_id_cache_unittest.cc:246: EXPECT_FALSE(cache.GetItemWithRestrictedID(7, &t)); Could you please add some tests that ...
7 years, 9 months ago (2013-03-19 21:48:30 UTC) #19
Shishir
Adding sky for chrome/common/... approval. PTAL. https://codereview.chromium.org/12498002/diff/46001/chrome/browser/search/instant_io_context.cc File chrome/browser/search/instant_io_context.cc (right): https://codereview.chromium.org/12498002/diff/46001/chrome/browser/search/instant_io_context.cc#newcode18 chrome/browser/search/instant_io_context.cc:18: const int kMostVisitedItemCacheSize ...
7 years, 9 months ago (2013-03-19 22:20:20 UTC) #20
sky
sky->brettw Brett, Shishir needs review of changes to chrome/common.
7 years, 9 months ago (2013-03-19 23:41:37 UTC) #21
brettw
We're trying to get better CL descriptions. This description doesn't really have any info on ...
7 years, 9 months ago (2013-03-20 20:52:46 UTC) #22
Shishir
On 2013/03/20 20:52:46, brettw wrote: > We're trying to get better CL descriptions. This description ...
7 years, 9 months ago (2013-03-20 21:18:51 UTC) #23
brettw
https://codereview.chromium.org/12498002/diff/61001/chrome/common/instant_restricted_id_cache.h File chrome/common/instant_restricted_id_cache.h (right): https://codereview.chromium.org/12498002/diff/61001/chrome/common/instant_restricted_id_cache.h#newcode156 chrome/common/instant_restricted_id_cache.h:156: while (cache_.size() > max_cache_size_) { I wonder if this ...
7 years, 9 months ago (2013-03-20 21:53:52 UTC) #24
Shishir
https://codereview.chromium.org/12498002/diff/61001/chrome/common/instant_restricted_id_cache.h File chrome/common/instant_restricted_id_cache.h (right): https://codereview.chromium.org/12498002/diff/61001/chrome/common/instant_restricted_id_cache.h#newcode156 chrome/common/instant_restricted_id_cache.h:156: while (cache_.size() > max_cache_size_) { On 2013/03/20 21:53:53, brettw ...
7 years, 9 months ago (2013-03-20 22:10:51 UTC) #25
Shishir
Hi Brett, I change the cache to use an MRUCache as you suggested. PTAL. Thanks.
7 years, 9 months ago (2013-03-21 06:53:05 UTC) #26
Shishir
On 2013/03/21 06:53:05, Shishir wrote: > Hi Brett, > > I change the cache to ...
7 years, 9 months ago (2013-03-21 22:09:53 UTC) #27
palmer
https://codereview.chromium.org/12498002/diff/78001/chrome/browser/search/instant_service.cc File chrome/browser/search/instant_service.cc (right): https://codereview.chromium.org/12498002/diff/78001/chrome/browser/search/instant_service.cc#newcode103 chrome/browser/search/instant_service.cc:103: return base::StringToUint64(path, &dummy); This code should be updated too. ...
7 years, 9 months ago (2013-03-21 22:58:04 UTC) #28
Shishir
https://codereview.chromium.org/12498002/diff/78001/chrome/browser/search/instant_service.cc File chrome/browser/search/instant_service.cc (right): https://codereview.chromium.org/12498002/diff/78001/chrome/browser/search/instant_service.cc#newcode103 chrome/browser/search/instant_service.cc:103: return base::StringToUint64(path, &dummy); On 2013/03/21 22:58:04, Chris P. wrote: ...
7 years, 9 months ago (2013-03-21 23:38:40 UTC) #29
palmer
lgtm
7 years, 9 months ago (2013-03-21 23:57:14 UTC) #30
brettw
owners lgtm but I don't understand the big picture, nor did I check the small ...
7 years, 9 months ago (2013-03-22 04:33:55 UTC) #31
Shishir
On 2013/03/22 04:33:55, brettw wrote: > owners lgtm but I don't understand the big picture, ...
7 years, 9 months ago (2013-03-22 05:16:48 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/shishir@chromium.org/12498002/88001
7 years, 9 months ago (2013-03-22 05:17:08 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/shishir@chromium.org/12498002/88001
7 years, 9 months ago (2013-03-22 18:17:41 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/shishir@chromium.org/12498002/85021
7 years, 9 months ago (2013-03-22 20:35:30 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/shishir@chromium.org/12498002/85021
7 years, 9 months ago (2013-03-23 14:55:00 UTC) #36
commit-bot: I haz the power
7 years, 9 months ago (2013-03-23 18:24:53 UTC) #37
Message was sent while issue was closed.
Change committed as 190052

Powered by Google App Engine
This is Rietveld 408576698