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

Unified Diff: third_party/WebKit/Source/devtools/front_end/profiler/ProfileHeader.js

Issue 2626313002: DevTools: split ProfilesPanel into multiple files. (Closed)
Patch Set: rebaselined Created 3 years, 11 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/profiler/ProfileHeader.js
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/ProfileHeader.js b/third_party/WebKit/Source/devtools/front_end/profiler/ProfileHeader.js
new file mode 100644
index 0000000000000000000000000000000000000000..a25d78ca59dba3ebaa4369eb5d0039431ac5bc73
--- /dev/null
+++ b/third_party/WebKit/Source/devtools/front_end/profiler/ProfileHeader.js
@@ -0,0 +1,121 @@
+// 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.
+
+/**
+ * @unrestricted
+ */
+Profiler.ProfileHeader = class extends Common.Object {
+ /**
+ * @param {?SDK.Target} target
+ * @param {!Profiler.ProfileType} profileType
+ * @param {string} title
+ */
+ constructor(target, profileType, title) {
+ super();
+ this._target = target;
+ this._profileType = profileType;
+ this.title = title;
+ this.uid = profileType.incrementProfileUid();
+ this._fromFile = false;
+ }
+
+ /**
+ * @return {?SDK.Target}
+ */
+ target() {
+ return this._target;
+ }
+
+ /**
+ * @return {!Profiler.ProfileType}
+ */
+ profileType() {
+ return this._profileType;
+ }
+
+ /**
+ * @param {?string} subtitle
+ * @param {boolean=} wait
+ */
+ updateStatus(subtitle, wait) {
+ this.dispatchEventToListeners(
+ Profiler.ProfileHeader.Events.UpdateStatus, new Profiler.ProfileHeader.StatusUpdate(subtitle, wait));
+ }
+
+ /**
+ * Must be implemented by subclasses.
+ * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate
+ * @return {!Profiler.ProfileSidebarTreeElement}
+ */
+ createSidebarTreeElement(dataDisplayDelegate) {
+ throw new Error('Needs implemented.');
+ }
+
+ /**
+ * @param {!Profiler.ProfileType.DataDisplayDelegate} dataDisplayDelegate
+ * @return {!UI.Widget}
+ */
+ createView(dataDisplayDelegate) {
+ throw new Error('Not implemented.');
+ }
+
+ removeTempFile() {
+ if (this._tempFile)
+ this._tempFile.remove();
+ }
+
+ dispose() {
+ }
+
+ /**
+ * @return {boolean}
+ */
+ canSaveToFile() {
+ return false;
+ }
+
+ saveToFile() {
+ throw new Error('Needs implemented');
+ }
+
+ /**
+ * @param {!File} file
+ */
+ loadFromFile(file) {
+ throw new Error('Needs implemented');
+ }
+
+ /**
+ * @return {boolean}
+ */
+ fromFile() {
+ return this._fromFile;
+ }
+
+ setFromFile() {
+ this._fromFile = true;
+ }
+};
+
+/**
+ * @unrestricted
+ */
+Profiler.ProfileHeader.StatusUpdate = class {
+ /**
+ * @param {?string} subtitle
+ * @param {boolean|undefined} wait
+ */
+ constructor(subtitle, wait) {
+ /** @type {?string} */
+ this.subtitle = subtitle;
+ /** @type {boolean|undefined} */
+ this.wait = wait;
+ }
+};
+
+/** @enum {symbol} */
+Profiler.ProfileHeader.Events = {
+ UpdateStatus: Symbol('UpdateStatus'),
+ ProfileReceived: Symbol('ProfileReceived')
+};

Powered by Google App Engine
This is Rietveld 408576698