Changeset 176203 in webkit


Ignore:
Timestamp:
Nov 17, 2014 9:07:13 AM (9 years ago)
Author:
rniwa@webkit.org
Message:

App.Manifest shouldn't use App.container.lookup
https://bugs.webkit.org/show_bug.cgi?id=138768

Reviewed by Andreas Kling.

Removed the hack to find the store object via App.container.lookup.
Pass around the store object instead.

  • public/v2/app.js:

(App.DashboardRow._createPane): Add "store" property to the pane.
(App.DashboardPaneProxyForPicker._platformOrMetricIdChanged): Ditto.
(App.IndexController.gridChanged): Ditto.
(App.IndexController.actions.addRow): Ditto.
(App.IndexController.init): Ditto.
(App.Pane._fetch): Ditto.
(App.ChartsController._parsePaneList): Ditto.
(App.ChartsController._updateQueryString): Ditto.
(App.ChartsController.actions.addPaneByMetricAndPlatform): Ditto.
(App.BuildPopup): Ditto.
(App.AnalysisTaskRoute.model): Ditto.
(App.AnalysisTaskViewModel._taskUpdated): Ditto.

  • public/v2/manifest.js:

(App.Manifest.fetch): Removed the code to find the store object.

Location:
trunk/Websites/perf.webkit.org
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Websites/perf.webkit.org/ChangeLog

    r175786 r176203  
     12014-11-17  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        App.Manifest shouldn't use App.__container__.lookup
     4        https://bugs.webkit.org/show_bug.cgi?id=138768
     5
     6        Reviewed by Andreas Kling.
     7
     8        Removed the hack to find the store object via App.__container__.lookup.
     9        Pass around the store object instead.
     10
     11        * public/v2/app.js:
     12        (App.DashboardRow._createPane): Add "store" property to the pane.
     13        (App.DashboardPaneProxyForPicker._platformOrMetricIdChanged): Ditto.
     14        (App.IndexController.gridChanged): Ditto.
     15        (App.IndexController.actions.addRow): Ditto.
     16        (App.IndexController.init): Ditto.
     17        (App.Pane._fetch): Ditto.
     18        (App.ChartsController._parsePaneList): Ditto.
     19        (App.ChartsController._updateQueryString): Ditto.
     20        (App.ChartsController.actions.addPaneByMetricAndPlatform): Ditto.
     21        (App.BuildPopup): Ditto.
     22        (App.AnalysisTaskRoute.model): Ditto.
     23        (App.AnalysisTaskViewModel._taskUpdated): Ditto.
     24
     25        * public/v2/manifest.js:
     26        (App.Manifest.fetch): Removed the code to find the store object.
     27
    1282014-11-08  Ryosuke Niwa  <rniwa@webkit.org>
    229
  • trunk/Websites/perf.webkit.org/public/v2/app.js

    r175786 r176203  
    3434
    3535        var pane = App.Pane.create({
     36            store: this.get('store'),
    3637            platformId: paneInfo ? paneInfo[0] : null,
    3738            metricId: paneInfo ? paneInfo[1] : null,
     
    4647    {
    4748        var self = this;
    48         App.BuildPopup('choosePane', this)
     49        App.BuildPopup(this.get('store'), 'choosePane', this)
    4950            .then(function (platforms) { self.set('pickerData', platforms); });
    5051    }.observes('platformId', 'metricId').on('init'),
     
    8889        }));
    8990
     91        var store = this.store;
    9092        this.set('rows', table.slice(1).map(function (rowParam) {
    9193            return App.DashboardRow.create({
     94                store: store,
    9295                header: rowParam[0],
    9396                cellsInfo: rowParam.slice(1),
     
    171174        {
    172175            this.get('rows').pushObject(App.DashboardRow.create({
     176                store: this.store,
    173177                header: this.get('newRowHeader'),
    174178                columnCount: this.get('columnCount'),
     
    196200    {
    197201        this._super();
    198         App.Manifest.fetch();
     202        App.Manifest.fetch(this.get('store'));
    199203    }
    200204});
     
    341345            var self = this;
    342346
    343             App.Manifest.fetchRunsWithPlatformAndMetric(this.store, platformId, metricId).then(function (result) {
     347            App.Manifest.fetchRunsWithPlatformAndMetric(this.get('store'), platformId, metricId).then(function (result) {
    344348                self.set('platform', result.platform);
    345349                self.set('metric', result.metric);
     
    511515            }
    512516            return App.Pane.create({
     517                store: self.store,
    513518                info: paneInfo,
    514519                platformId: paneInfo[0],
     
    562567        {
    563568            this.addPane(App.Pane.create({
     569                store, this.store,
    564570                platformId: param.platform.get('id'),
    565571                metricId: param.metric.get('id'),
     
    573579        this._super();
    574580        var self = this;
    575         App.BuildPopup('addPaneByMetricAndPlatform').then(function (platforms) {
     581        App.BuildPopup(this.store, 'addPaneByMetricAndPlatform').then(function (platforms) {
    576582            self.set('platforms', platforms);
    577583        });
     
    579585});
    580586
    581 App.BuildPopup = function(action, position)
     587App.BuildPopup = function(store, action, position)
    582588{
    583     return App.Manifest.fetch().then(function () {
     589    return App.Manifest.fetch(store).then(function () {
    584590        return App.Manifest.get('platforms').map(function (platform) {
    585591            return App.PlatformProxyForPopup.create({content: platform,
     
    15931599App.AnalysisTaskRoute = Ember.Route.extend({
    15941600    model: function (param) {
    1595         var store = this.store;
    1596         return this.store.find('analysisTask', param.taskId).then(function (task) {
    1597             return App.AnalysisTaskViewModel.create({content: task});
     1601        return store.find('analysisTask', param.taskId).then(function (task) {
     1602            return App.AnalysisTaskViewModel.create({content: task, store: store});
    15981603        });
    15991604    },
     
    16071612        var platformId = this.get('platform').get('id');
    16081613        var metricId = this.get('metric').get('id');
    1609         App.Manifest.fetchRunsWithPlatformAndMetric(this.store, platformId, metricId).then(this._fetchedRuns.bind(this));
     1614        App.Manifest.fetchRunsWithPlatformAndMetric(this.get('store'), platformId, metricId).then(this._fetchedRuns.bind(this));
    16101615    }.observes('platform', 'metric').on('init'),
    16111616    _fetchedRuns: function (data) {
  • trunk/Websites/perf.webkit.org/public/v2/manifest.js

    r175768 r176203  
    161161    _repositoryById: {},
    162162    _fetchPromise: null,
    163     fetch: function ()
    164     {
    165         if (this._fetchPromise)
    166             return this._fetchPromise;
    167         // FIXME: We shouldn't use DS.Store at all.
    168         var store = App.__container__.lookup('store:main');
    169         var promise = store.findAll('platform');
    170         this._fetchPromise = promise.then(this._fetchedManifest.bind(this, store));
     163    fetch: function (store)
     164    {
     165        if (!this._fetchPromise)
     166            this._fetchPromise = store.findAll('platform').then(this._fetchedManifest.bind(this, store));
    171167        return this._fetchPromise;
    172168    },
Note: See TracChangeset for help on using the changeset viewer.