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

Unified Diff: tools/dom/src/native_DOMImplementation.dart

Issue 1879093002: Revert "Fix handling of cross-origin windows in dartium and better align general handling of differ… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/dom/scripts/systemnative.py ('k') | tools/dom/templates/html/dartium/html_dartium.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/native_DOMImplementation.dart
diff --git a/tools/dom/src/native_DOMImplementation.dart b/tools/dom/src/native_DOMImplementation.dart
index 8847ea715886dacca08d92dba31e54d13496ff42..713f6ec270cc69d3ecfd764ae879a0d6a024b76f 100644
--- a/tools/dom/src/native_DOMImplementation.dart
+++ b/tools/dom/src/native_DOMImplementation.dart
@@ -1065,31 +1065,33 @@ class _Utils {
_blink.Blink_Utils.createElement(document, tagName);
}
+// TODO(jacobr): this seems busted. I believe we are actually
+// giving users real windows for opener, parent, top, etc.
+// Or worse, we are probaly returning a raw JSObject.
class _DOMWindowCrossFrame extends DartHtmlDomObject implements WindowBase {
_DOMWindowCrossFrame.internal();
static _createSafe(win) =>
- win is _DOMWindowCrossFrame ? win : _blink.Blink_Utils.setInstanceInterceptor(win, _DOMWindowCrossFrame);
+ _blink.Blink_Utils.setInstanceInterceptor(win, _DOMWindowCrossFrame);
// Fields.
- HistoryBase get history {
- var history = _blink.BlinkWindow.instance.history_Getter_(this);
- return history is _HistoryCrossFrame ? history : _blink.Blink_Utils.setInstanceInterceptor(history, _HistoryCrossFrame);
- }
-
- LocationBase get location {
- var location = _blink.BlinkWindow.instance.location_Getter_(this);
- return location is _LocationCrossFrame ? location : _blink.Blink_Utils.setInstanceInterceptor(location, _LocationCrossFrame);
- }
-
- bool get closed => _blink.BlinkWindow.instance.closed_Getter_(this);
- WindowBase get opener => _convertNativeToDart_Window(_blink.BlinkWindow.instance.opener_Getter_(this));
- WindowBase get parent => _convertNativeToDart_Window(_blink.BlinkWindow.instance.parent_Getter_(this));
- WindowBase get top => _convertNativeToDart_Window(_blink.BlinkWindow.instance.top_Getter_(this));
+ HistoryBase get history => _blink.Blink_DOMWindowCrossFrame.get_history(this);
+ LocationBase get location =>
+ _blink.Blink_DOMWindowCrossFrame.get_location(this);
+ bool get closed => _blink.Blink_DOMWindowCrossFrame.get_closed(this);
+ WindowBase get opener => _blink.Blink_DOMWindowCrossFrame.get_opener(this);
+ WindowBase get parent => _blink.Blink_DOMWindowCrossFrame.get_parent(this);
+ WindowBase get top => _blink.Blink_DOMWindowCrossFrame.get_top(this);
// Methods.
- void close() => _blink.BlinkWindow.instance.close_Callback_0_(this);
- void postMessage(Object message, String targetOrigin, [List<MessagePort> transfer]) => _blink.BlinkWindow.instance.postMessage_Callback_3_(this, convertDartToNative_SerializedScriptValue(message), targetOrigin, transfer);
+ void close() => _blink.Blink_DOMWindowCrossFrame.close(this);
+ void postMessage(/*SerializedScriptValue*/ message, String targetOrigin,
+ [List messagePorts]) =>
+ _blink.Blink_DOMWindowCrossFrame.postMessage(
+ this,
+ convertDartToNative_SerializedScriptValue(message),
+ targetOrigin,
+ messagePorts);
// Implementation support.
String get typeName => "Window";
@@ -1126,16 +1128,9 @@ class _HistoryCrossFrame extends DartHtmlDomObject implements HistoryBase {
_HistoryCrossFrame.internal();
// Methods.
- void back() => _blink.BlinkHistory.instance.back_Callback_0_(this);
- void forward() => _blink.BlinkHistory.instance.forward_Callback_0_(this);
- void go([int delta]) {
- if (delta != null) {
- _blink.BlinkHistory.instance.go_Callback_1_(this, delta);
- return;
- }
- _blink.BlinkHistory.instance.go_Callback_0_(this);
- return;
- }
+ void back() => _blink.Blink_HistoryCrossFrame.back(this);
+ void forward() => _blink.Blink_HistoryCrossFrame.forward(this);
+ void go(int distance) => _blink.Blink_HistoryCrossFrame.go(this, distance);
// Implementation support.
String get typeName => "History";
@@ -1145,7 +1140,7 @@ class _LocationCrossFrame extends DartHtmlDomObject implements LocationBase {
_LocationCrossFrame.internal();
// Fields.
- set href(String value) => _blink.BlinkLocation.instance.href_Setter_(this, value);
+ set href(String h) => _blink.Blink_LocationCrossFrame.set_href(this, h);
// Implementation support.
String get typeName => "Location";
« no previous file with comments | « tools/dom/scripts/systemnative.py ('k') | tools/dom/templates/html/dartium/html_dartium.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698