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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 1414903007: Serialize the data argument to History's state-related APIs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add a TODO Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 4983498edec900e99d976dbe893ba157b6ecd64c..b0e17b3455dee7c9526f96cc16c4922dedc90bf8 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -17864,7 +17864,32 @@ class History extends Interceptor implements HistoryBase {
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
- void pushState(Object data, String title, [String url]) native;
+ void pushState(/*any*/ data, String title, [String url]) {
+ if (url != null) {
+ var data_1 = convertDartToNative_SerializedScriptValue(data);
+ _pushState_1(data_1, title, url);
+ return;
+ }
+ var data_1 = convertDartToNative_SerializedScriptValue(data);
+ _pushState_2(data_1, title);
+ return;
+ }
+ @JSName('pushState')
+ @DomName('History.pushState')
+ @DocsEditable()
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.FIREFOX)
+ @SupportedBrowser(SupportedBrowser.IE, '10')
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ void _pushState_1(data, title, url) native;
+ @JSName('pushState')
+ @DomName('History.pushState')
+ @DocsEditable()
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.FIREFOX)
+ @SupportedBrowser(SupportedBrowser.IE, '10')
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ void _pushState_2(data, title) native;
@DomName('History.replaceState')
@DocsEditable()
@@ -17872,7 +17897,32 @@ class History extends Interceptor implements HistoryBase {
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
- void replaceState(Object data, String title, [String url]) native;
+ void replaceState(/*any*/ data, String title, [String url]) {
+ if (url != null) {
+ var data_1 = convertDartToNative_SerializedScriptValue(data);
+ _replaceState_1(data_1, title, url);
+ return;
+ }
+ var data_1 = convertDartToNative_SerializedScriptValue(data);
+ _replaceState_2(data_1, title);
+ return;
+ }
+ @JSName('replaceState')
+ @DomName('History.replaceState')
+ @DocsEditable()
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.FIREFOX)
+ @SupportedBrowser(SupportedBrowser.IE, '10')
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ void _replaceState_1(data, title, url) native;
+ @JSName('replaceState')
+ @DomName('History.replaceState')
+ @DocsEditable()
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.FIREFOX)
+ @SupportedBrowser(SupportedBrowser.IE, '10')
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ void _replaceState_2(data, title) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698