New issue
Advanced search Search tips

Issue 640247 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug

Blocked on:
issue 638735
issue 641006

Blocking:
issue 636655



Sign in to add a comment

Extension schemas are double-parsed in the renderer

Project Member Reported by rdevlin....@chromium.org, Aug 23 2016

Issue description

In order to pass the extension schema to JS, we do the following:
1. Parse the schema string to a base::DictionaryValue
2. Modify it to prefix types
3. Convert from a base::DictionaryValue to a v8::Value

 issue 638735  is handling removing 2, which means we would go from string -> dictionary value -> v8::Value.  However, v8 offers a JSON::Parse API.  Theoretically, we should be able to go straight from string -> v8::Value, which would cut down on both parsing and copying the data.
 
Blockedon: 641006
Project Member

Comment 2 by bugdroid1@chromium.org, Aug 26 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2fdf3d97334819323dc2f42e79fb9d897b069ec4

commit 2fdf3d97334819323dc2f42e79fb9d897b069ec4
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Fri Aug 26 16:11:32 2016

[Extensions] Parse schema string directly into a v8 object

In the renderer, we need to parse the extension schema string and pass
it to JS in order to create our bindings. However, right now, we first
parse this into a DictionaryValue, and then convert it into a
v8::Object. However, now that we fully generate all the schema code, we
should be able to parse it directly from a string into a v8::Object.

BUG= 640247 

Review-Url: https://codereview.chromium.org/2271813003
Cr-Commit-Position: refs/heads/master@{#414725}

[modify] https://crrev.com/2fdf3d97334819323dc2f42e79fb9d897b069ec4/extensions/common/extension_api.cc
[modify] https://crrev.com/2fdf3d97334819323dc2f42e79fb9d897b069ec4/extensions/common/extension_api.h
[modify] https://crrev.com/2fdf3d97334819323dc2f42e79fb9d897b069ec4/extensions/renderer/v8_schema_registry.cc

Components: Platform>Extensions
Status: Fixed (was: Assigned)

Sign in to add a comment