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

Side by Side Diff: lib/src/common/polymer_mixin.dart

Issue 1351693003: Update to use one less proxy per element (Closed) Base URL: git@github.com:dart-lang/polymer-dart.git@behaviors
Patch Set: update comments Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/src/common/polymer_descriptor.dart ('k') | lib/src/common/polymer_serialize.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 library polymer.src.common.polymer_js_proxy; 4 library polymer.src.common.polymer_js_proxy;
5 5
6 import 'dart:js'; 6 import 'dart:js';
7 import 'package:polymer_interop/polymer_interop.dart' show Polymer, PolymerDom; 7 import 'package:polymer_interop/polymer_interop.dart' show Polymer, PolymerDom;
8 import 'package:web_components/web_components.dart'; 8 import 'package:web_components/web_components.dart';
9 import 'js_proxy.dart'; 9 import 'js_proxy.dart';
10 10
11 /// Basic api for re-using the polymer js prototypes. 11 /// Basic api for re-using the polymer js prototypes.
12 abstract class PolymerMixin implements JsProxy, CustomElementProxyMixin { 12 abstract class PolymerMixin implements JsProxy, CustomElementProxyMixin {
13 JsObject _proxy; 13 JsObject _proxy;
14 14
15 JsObject get jsElement { 15 JsObject get jsElement {
16 if (_proxy == null) { 16 if (_proxy == null) {
17 _proxy = new JsObject.fromBrowserObject(this); 17 _proxy = new JsObject.fromBrowserObject(this);
18 _proxy['__data__'] = jsProxy;
19 } 18 }
20 return _proxy; 19 return _proxy;
21 } 20 }
22 21
23 void polymerCreated() { 22 void polymerCreated() {
24 // Use a cache for js proxy values.
25 useCache = true;
26 jsElement.callMethod('originalPolymerCreatedCallback'); 23 jsElement.callMethod('originalPolymerCreatedCallback');
27 } 24 }
25
26
28 } 27 }
OLDNEW
« no previous file with comments | « lib/src/common/polymer_descriptor.dart ('k') | lib/src/common/polymer_serialize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698