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

Issue 11553012: Better ability to have hand-written custom rules and various cleanups. (Closed)

Created:
8 years ago by Alan Knight
Modified:
8 years ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Better ability to have hand-written custom rules and various cleanups. In particular, added CustomRule with a simplified set of methods for subclasses to implement, renamed ClosureToMapRule to ClosureRule and made it a subclass of CustomRule. Custom rules that return lists will work either in the map or list format. Those that return maps will only work in the map format. Introduced implementations of Map and List that resolve references only on demand as part of the simplifications. Since we don't have a way to serialize CustomRule, made selfDescribing be off by default if those are used. Generalized the ClassMirrorRule to general support for named objects both on read and write with a specific subclass for DeclarationMirrors so that they are set up automatically on write. Still the user's responsibility on read. Removed a bunch of declarations of things as Object, which didn't add any information and just made for spurious type warnings. Simplified the API so just read/write that take a single object. Removed readOne/writeOne. If you want multiple objects, use a collection as the single object. Slightly generalized the dumpStateInto and related flat format methods. They should still go away in favor of a more general mechanism, but at least there's less code duplication now. BUG=

Patch Set 1 #

Total comments: 18

Patch Set 2 : Changes from John's review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+434 lines, -161 lines) Patch
M pkg/serialization/lib/serialization.dart View 1 8 chunks +62 lines, -27 lines 0 comments Download
M pkg/serialization/lib/src/basic_rule.dart View 3 chunks +3 lines, -3 lines 0 comments Download
M pkg/serialization/lib/src/polyfill_identity_set.dart View 1 chunk +1 line, -2 lines 0 comments Download
M pkg/serialization/lib/src/reader_writer.dart View 1 21 chunks +44 lines, -50 lines 0 comments Download
M pkg/serialization/lib/src/serialization_helpers.dart View 1 chunk +1 line, -3 lines 0 comments Download
M pkg/serialization/lib/src/serialization_rule.dart View 1 14 chunks +279 lines, -60 lines 0 comments Download
M pkg/serialization/test/serialization_test.dart View 13 chunks +44 lines, -16 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Alan Knight
See description for an overview of what's changed.
8 years ago (2012-12-12 18:29:36 UTC) #1
Jennifer Messerly
looks great, just a few minor comments https://chromiumcodereview.appspot.com/11553012/diff/1/pkg/serialization/lib/serialization.dart File pkg/serialization/lib/serialization.dart (right): https://chromiumcodereview.appspot.com/11553012/diff/1/pkg/serialization/lib/serialization.dart#newcode198 pkg/serialization/lib/serialization.dart:198: _selfDescribing = ...
8 years ago (2012-12-12 20:38:28 UTC) #2
Alan Knight
https://codereview.chromium.org/11553012/diff/1/pkg/serialization/lib/serialization.dart File pkg/serialization/lib/serialization.dart (right): https://codereview.chromium.org/11553012/diff/1/pkg/serialization/lib/serialization.dart#newcode198 pkg/serialization/lib/serialization.dart:198: _selfDescribing = !rules.some((x) => x is CustomRule); On 2012/12/12 ...
8 years ago (2012-12-12 21:19:33 UTC) #3
Jennifer Messerly
lgtm
8 years ago (2012-12-12 21:26:46 UTC) #4
Alan Knight
8 years ago (2012-12-14 22:16:41 UTC) #5
Message was sent while issue was closed.
This was committed as https://chromiumcodereview.appspot.com/11578037/

Powered by Google App Engine
This is Rietveld 408576698