resending

On Wed, Jul 15, 2009 at 3:08 PM, Erik Kay <erik...@google.com> wrote:

> On Wed, Jul 15, 2009 at 12:04 PM, Aaron Boodman <a...@chromium.org> wrote:
>
>>
>> On Wed, Jul 15, 2009 at 11:30 AM, Matt Perry<mpcompl...@chromium.org>
>> wrote:
>> > On Wed, Jul 15, 2009 at 9:59 AM, Aaron Boodman <a...@chromium.org> wrote:
>> >>
>> >> a) I think it is important to not break the extension system with this
>> >> mod, so that means that for awhile (1 or 2 dev channel releases?) we
>> >> will both write the entire manifest to the prefs and load from disk
>> >> normally.
>> >
>> > What if on extension load, we checked the prefs first, and if the
>> manifest
>> > entry was absent, then we loaded from disk?  New extension installs
>> would
>> > write only to the pref.  Seems like that would get us transparent
>> backwards
>> > compat.
>>
>> You're right, that is another way to do it.
>
>
> +1 to Matt's approach here.
>
>
> >> b) Extension prefs are currently written in
>> >> ExtensionsService::OnExtensionInstalled. At this point, we no longer
>> >> have the JSON form of the manifest, it has already been parsed into an
>> >> Extension object.
>> >
>> > It's easy enough to pass along the JSON object from OnExtensionUnpacked,
>> > which calls OnExtensionInstalled.
>>
>> True, but it felt really messy to me. Basically this means that we end
>> up with two representations of the extension: the Extension manifest
>> and the Extension object. The object contains all kinds of extra state
>> like the location, the path, etc. It seems like an area for potential
>> confusion.
>>
>> >> b) and c) lead me to the conclusion that we should refactor the
>> >> Extension class so that it is a lightweight wrapper around a JSON
>> >> dictionary and has no state of its own. This would fix the problem of
>> >> not having access to the JSON representation and therefore having to
>> >> write serialization code for it.
>> >
>> > A less radical approach would be to keep a copy of the JSON dictionary
>> in
>> > the Extension class while we're in this migration period.  That's not to
>> say
>> > we shouldn't refactor the Extension class (I have no opinion on that).
>>
>> True.
>
>
> Refactoring Extension to be a light-weight wrapper around DictionaryValue
> seems reasonable.  It's somewhat annoying that every time someone wants a
> property that the code will need to go through all of the (if has key, get
> key) work (potentially through multiple levels of hierarchy), but I don't
> think that there's a practical downside (we don't ask for properties very
> often).  It also means that we'll wind up duplicating a fair amount of code
> between validation and access, but again I don't see this as a huge problem
> either.
>
> Random wacky thought: perhaps validation could be done using JSON schema?
>  (although it doesn't really fit in this case since this is running in the
> browser)
>
> Erik
>
>

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to