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

Issue 10450009: DomStorageCachedArea + DomStorageProxy interface and unittests. These classes aren't used yet. (Closed)

Created:
8 years, 7 months ago by michaeln
Modified:
8 years, 7 months ago
Reviewers:
tony, jsbell
CC:
chromium-reviews, darin-cc_chromium.org, pam+watch_chromium.org, ericu
Visibility:
Public.

Description

DomStorageCachedArea + DomStorageProxy interface and unittests. These classes aren't used yet. BUG=94382 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=138921

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 8

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+681 lines, -1 line) Patch
A webkit/dom_storage/dom_storage_cached_area.h View 1 2 3 4 1 chunk +87 lines, -0 lines 0 comments Download
A webkit/dom_storage/dom_storage_cached_area.cc View 1 2 1 chunk +194 lines, -0 lines 0 comments Download
A webkit/dom_storage/dom_storage_cached_area_unittest.cc View 1 2 3 4 1 chunk +349 lines, -0 lines 0 comments Download
M webkit/dom_storage/dom_storage_map.h View 1 2 chunks +3 lines, -1 line 0 comments Download
A webkit/dom_storage/dom_storage_proxy.h View 1 2 3 4 1 chunk +44 lines, -0 lines 0 comments Download
M webkit/dom_storage/webkit_dom_storage.gypi View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M webkit/tools/test_shell/test_shell.gypi View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
michaeln
Here's the first chunk of the larger CL. Josh, since eric's out till next tuesday, ...
8 years, 7 months ago (2012-05-24 01:49:56 UTC) #1
michaeln
@tony, should we be putting new unittests in content_tests? i can move the existing dom_storage ...
8 years, 7 months ago (2012-05-24 18:49:34 UTC) #2
tony
On 2012/05/24 18:49:34, michaeln wrote: > @tony, should we be putting new unittests in content_tests? ...
8 years, 7 months ago (2012-05-24 18:59:42 UTC) #3
jsbell
lgtm, with just nits and a question. https://chromiumcodereview.appspot.com/10450009/diff/9002/webkit/dom_storage/dom_storage_cached_area.h File webkit/dom_storage/dom_storage_cached_area.h (right): https://chromiumcodereview.appspot.com/10450009/diff/9002/webkit/dom_storage/dom_storage_cached_area.h#newcode46 webkit/dom_storage/dom_storage_cached_area.h:46: // Primes ...
8 years, 7 months ago (2012-05-24 20:20:22 UTC) #4
michaeln
8 years, 7 months ago (2012-05-24 20:43:11 UTC) #5
Thnx for looking... also renamed Proxy::AsyncOperationCallback to just
CompletionCallback

https://chromiumcodereview.appspot.com/10450009/diff/9002/webkit/dom_storage/...
File webkit/dom_storage/dom_storage_cached_area.h (right):

https://chromiumcodereview.appspot.com/10450009/diff/9002/webkit/dom_storage/...
webkit/dom_storage/dom_storage_cached_area.h:46: // Primes the cache, loading
all values for the area.
On 2012/05/24 20:20:22, jsbell wrote:
> Can you add a comment near the top of the class indicating that this is a
> complete cache, not a sparse cache?

Done.

// Unlike the other classes in the dom_storage library, this one is intended
// for use in renderer processes. It maintains a complete cach of the an
// origin's Map of key/value pairs for fast access. The cache is primed on
// first access and changes are written to the backend thru the |proxy|.
// Mutations originating in other processes are applied to the cache via
// the ApplyMutation method.

https://chromiumcodereview.appspot.com/10450009/diff/9002/webkit/dom_storage/...
webkit/dom_storage/dom_storage_cached_area.h:53: // Resets the class back to its
newly constructed state.
On 2012/05/24 20:20:22, jsbell wrote:
> Nit: s/class/object/

Done.

https://chromiumcodereview.appspot.com/10450009/diff/9002/webkit/dom_storage/...
File webkit/dom_storage/dom_storage_cached_area_unittest.cc (right):

https://chromiumcodereview.appspot.com/10450009/diff/9002/webkit/dom_storage/...
webkit/dom_storage/dom_storage_cached_area_unittest.cc:16: // An mock
implementation of the DomStorageProxy interface.
On 2012/05/24 20:20:22, jsbell wrote:
> Nit: s/An/A/

Done.

https://chromiumcodereview.appspot.com/10450009/diff/9002/webkit/dom_storage/...
webkit/dom_storage/dom_storage_cached_area_unittest.cc:299: // completion
callback should have been cancelled.
On 2012/05/24 20:20:22, jsbell wrote:
> I'm not seeing how the first is cancelled (either in the code or test). Can
you
> explain?

DomStorageCachedArea::Reset() calls weak_factory_.InvalidateWeakPtrs(). Each
completion callback holds weakptr back to the cachedArea. After those weakptrs
have been invalidated, running the callback will be a noop, it won't call into
the cachedArea method it was bound to.

The test verifies the first callback is ignored by testing
IsIgnoringAllMutations after having invoked the first callback. If
OnClearComplete had run, the ignore flag would have been reset to false and that
expectation would fail.

Powered by Google App Engine
This is Rietveld 408576698