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

Unified Diff: third_party/WebKit/Source/devtools/front_end/network/HARLoader.js

Issue 2948173005: har import
Patch Set: Created 3 years, 6 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
Index: third_party/WebKit/Source/devtools/front_end/network/HARLoader.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network/HARLoader.js b/third_party/WebKit/Source/devtools/front_end/network/HARLoader.js
new file mode 100644
index 0000000000000000000000000000000000000000..25f6e495d3470089f6c2fa19f36ac8b7e726fa46
--- /dev/null
+++ b/third_party/WebKit/Source/devtools/front_end/network/HARLoader.js
@@ -0,0 +1,43 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @implements {Bindings.OutputStreamDelegate}
+ */
+Network.HARLoader = class {
+ constructor(file) {
+ this._outputStream = new Common.StringOutputStream();
+
+ var fileReader = new Bindings.ChunkedFileReader(file, Network.HARLoader.TransferChunkLengthBytes, this);
+ fileReader.start(this._outputStream);
+ }
+
+ /**
+ * @override
+ */
+ onTransferStarted() {}
+
+ /**
+ * @override
+ */
+ onTransferFinished() {
+ var json = JSON.parse(this._outputStream.data());
+ NetworkLog.networkLog.loadHAR(json);
+ }
+
+ /**
+ * @override
+ * @param {!Bindings.ChunkedReader} reader
+ */
+ onChunkTransferred(reader) {}
+
+ /**
+ * @override
+ * @param {!Bindings.ChunkedReader} reader
+ * @param {!Event} event
+ */
+ onError(reader, event) {}
+};
+
+Network.HARLoader.TransferChunkLengthBytes = 5000000;
« no previous file with comments | « third_party/WebKit/Source/devtools/BUILD.gn ('k') | third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698