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

Unified Diff: usage/lib/src/usage_impl_html.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « usage/lib/src/usage_impl.dart ('k') | usage/lib/src/usage_impl_io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: usage/lib/src/usage_impl_html.dart
diff --git a/usage/lib/src/usage_impl_html.dart b/usage/lib/src/usage_impl_html.dart
deleted file mode 100644
index fafd77a8952955949e1b431af15ab951b5b63cfc..0000000000000000000000000000000000000000
--- a/usage/lib/src/usage_impl_html.dart
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library usage_impl_html;
-
-import 'dart:async';
-import 'dart:convert' show JSON;
-import 'dart:html';
-
-import 'usage_impl.dart';
-
-class HtmlPostHandler extends PostHandler {
- final Function mockRequestor;
-
- HtmlPostHandler({Function this.mockRequestor});
-
- Future sendPost(String url, Map<String, String> parameters) {
- int viewportWidth = document.documentElement.clientWidth;
- int viewportHeight = document.documentElement.clientHeight;
-
- parameters['vp'] = '${viewportWidth}x$viewportHeight';
-
- String data = postEncode(parameters);
- var request = mockRequestor == null ? HttpRequest.request : mockRequestor;
- return request(url, method: 'POST', sendData: data).catchError((e) {
- // Catch errors that can happen during a request, but that we can't do
- // anything about, e.g. a missing internet conenction.
- });
- }
-}
-
-class HtmlPersistentProperties extends PersistentProperties {
- Map _map;
-
- HtmlPersistentProperties(String name) : super(name) {
- String str = window.localStorage[name];
- if (str == null || str.isEmpty) str = '{}';
- _map = JSON.decode(str);
- }
-
- dynamic operator[](String key) => _map[key];
-
- void operator[]=(String key, dynamic value) {
- if (value == null) {
- _map.remove(key);
- } else {
- _map[key] = value;
- }
-
- window.localStorage[name] = JSON.encode(_map);
- }
-}
« no previous file with comments | « usage/lib/src/usage_impl.dart ('k') | usage/lib/src/usage_impl_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698